diff --git a/.eslintignore b/.eslintignore index ea5b04aeb..c4a0963e9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,4 @@ build/ docs/ protos/ samples/generated/ +system-test/**/fixtures diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a3d003c65..fbf0659c3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:e08f9a3757808cdaf7a377e962308c65c4d7eff12db206d4fae702dd50d43430 -# created: 2023-08-03T18:46:14.719706948Z + digest: sha256:bfe4592953269bfa8d135200ca1b17809f106a337a885d7ecc12cd2a9998e98a +# created: 2023-11-15T20:00:24.246072277Z diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 1350faeff..b46e4c4d6 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -7,7 +7,6 @@ branchProtectionRules: requiredStatusCheckContexts: - "ci/kokoro: Samples test" - "ci/kokoro: System test" - - docs - lint - test (14) - test (16) diff --git a/.github/workflows/system-tests-against-emulator.yaml b/.github/workflows/system-tests-against-emulator.yaml index 3487cb4ca..3df4a38ec 100644 --- a/.github/workflows/system-tests-against-emulator.yaml +++ b/.github/workflows/system-tests-against-emulator.yaml @@ -16,7 +16,7 @@ jobs: - 9020:9020 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - uses: actions/setup-node@v3 with: node-version: 14 diff --git a/.kokoro/release/docs-devsite.sh b/.kokoro/release/docs-devsite.sh index 3596c1e4c..81a89f6c1 100755 --- a/.kokoro/release/docs-devsite.sh +++ b/.kokoro/release/docs-devsite.sh @@ -25,6 +25,6 @@ if [[ -z "$CREDENTIALS" ]]; then fi npm install -npm install --no-save @google-cloud/cloud-rad@^0.3.7 +npm install --no-save @google-cloud/cloud-rad@^0.4.0 # publish docs to devsite npx @google-cloud/cloud-rad . cloud-rad diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fd1215fb..13aa34cf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions +## [7.1.0](https://github.com/googleapis/nodejs-spanner/compare/v7.0.0...v7.1.0) (2023-11-16) + + +### Features + +* Add PG.OID type cod annotation ([69192b5](https://github.com/googleapis/nodejs-spanner/commit/69192b50ead0bde98676cb647ba4bf8a3112bb02)) +* **spanner:** Add autoscaling config to the instance proto ([#1935](https://github.com/googleapis/nodejs-spanner/issues/1935)) ([fe285c6](https://github.com/googleapis/nodejs-spanner/commit/fe285c67074ba36aaf5b49ea867c0d5851d83717)) +* **spanner:** Add directed_read_option in spanner.proto ([69192b5](https://github.com/googleapis/nodejs-spanner/commit/69192b50ead0bde98676cb647ba4bf8a3112bb02)) + + +### Bug Fixes + +* **deps:** Update dependency @types/stack-trace to v0.0.31 ([#1924](https://github.com/googleapis/nodejs-spanner/issues/1924)) ([96af405](https://github.com/googleapis/nodejs-spanner/commit/96af4051c6717dfcbbc6e117e3ecd7f8e9dd758a)) +* **deps:** Update dependency @types/stack-trace to v0.0.32 ([#1939](https://github.com/googleapis/nodejs-spanner/issues/1939)) ([cb66474](https://github.com/googleapis/nodejs-spanner/commit/cb66474e995a90c1288e70842f723c51f1ffd37d)) +* **deps:** Update dependency google-gax to v4.0.4 ([#1926](https://github.com/googleapis/nodejs-spanner/issues/1926)) ([361fe6a](https://github.com/googleapis/nodejs-spanner/commit/361fe6a812f56c6834f1f7c7db60fc1083243768)) +* **deps:** Update dependency google-gax to v4.0.5 ([#1937](https://github.com/googleapis/nodejs-spanner/issues/1937)) ([ab26075](https://github.com/googleapis/nodejs-spanner/commit/ab260759be2fcc9ff80342f710b4c807742da2c5)) + ## [7.0.0](https://github.com/googleapis/nodejs-spanner/compare/v6.16.0...v7.0.0) (2023-08-30) diff --git a/package.json b/package.json index 7d5587911..6a2eba758 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/spanner", "description": "Cloud Spanner Client Library for Node.js", - "version": "7.0.0", + "version": "7.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { @@ -57,7 +57,7 @@ "@google-cloud/promisify": "^4.0.0", "@grpc/proto-loader": "^0.7.0", "@types/big.js": "^6.0.0", - "@types/stack-trace": "0.0.29", + "@types/stack-trace": "0.0.32", "arrify": "^2.0.0", "big.js": "^6.0.0", "checkpoint-stream": "^0.1.1", @@ -65,7 +65,7 @@ "events-intercept": "^2.0.0", "extend": "^3.0.2", "google-auth-library": "^9.0.0", - "google-gax": "^4.0.3", + "google-gax": "4.0.5", "grpc-gcp": "^1.0.0", "is": "^3.2.1", "lodash.snakecase": "^4.1.1", @@ -82,7 +82,7 @@ "devDependencies": { "@types/concat-stream": "^2.0.0", "@types/extend": "^3.0.0", - "@types/is": "0.0.22", + "@types/is": "0.0.24", "@types/lodash.snakecase": "^4.1.4", "@types/merge-stream": "^1.1.2", "@types/mocha": "^9.0.0", @@ -99,7 +99,7 @@ "concat-stream": "^2.0.0", "dedent": "^0.7.0", "execa": "^5.0.0", - "gapic-tools": "^0.1.8", + "gapic-tools": "^0.2.0", "gts": "^5.0.0", "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", diff --git a/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto index 0b4a35705..58051df00 100644 --- a/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ b/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -562,6 +562,66 @@ message InstanceConfig { State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Autoscaling config for an instance. +message AutoscalingConfig { + // The autoscaling limits for the instance. Users can define the minimum and + // maximum compute capacity allocated to the instance, and the autoscaler will + // only scale within that range. Users can either use nodes or processing + // units to specify the limits, but should use the same unit to set both the + // min_limit and max_limit. + message AutoscalingLimits { + // The minimum compute capacity for the instance. + oneof min_limit { + // Minimum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to 1. + int32 min_nodes = 1; + + // Minimum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000. + int32 min_processing_units = 2; + } + + // The maximum compute capacity for the instance. The maximum compute + // capacity should be less than or equal to 10X the minimum compute + // capacity. + oneof max_limit { + // Maximum number of nodes allocated to the instance. If set, this number + // should be greater than or equal to min_nodes. + int32 max_nodes = 3; + + // Maximum number of processing units allocated to the instance. If set, + // this number should be multiples of 1000 and be greater than or equal to + // min_processing_units. + int32 max_processing_units = 4; + } + } + + // The autoscaling targets for an instance. + message AutoscalingTargets { + // Required. The target high priority cpu utilization percentage that the + // autoscaler should be trying to achieve for the instance. This number is + // on a scale from 0 (no utilization) to 100 (full utilization). The valid + // range is [10, 90] inclusive. + int32 high_priority_cpu_utilization_percent = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The target storage utilization percentage that the autoscaler + // should be trying to achieve for the instance. This number is on a scale + // from 0 (no utilization) to 100 (full utilization). The valid range is + // [10, 100] inclusive. + int32 storage_utilization_percent = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Autoscaling limits for an instance. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The autoscaling targets for an instance. + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // An isolated set of Cloud Spanner resources on which databases can be hosted. message Instance { option (google.api.resource) = { @@ -606,8 +666,12 @@ message Instance { string display_name = 3 [(google.api.field_behavior) = REQUIRED]; // The number of nodes allocated to this instance. At most one of either - // node_count or processing_units should be present in the message. This - // may be zero in API responses for instances that are not yet in state + // node_count or processing_units should be present in the message. + // + // Users can set the node_count field to specify the target number of nodes + // allocated to the instance. + // + // This may be zero in API responses for instances that are not yet in state // `READY`. // // See [the @@ -616,14 +680,26 @@ message Instance { int32 node_count = 5; // The number of processing units allocated to this instance. At most one of - // processing_units or node_count should be present in the message. This may - // be zero in API responses for instances that are not yet in state `READY`. + // processing_units or node_count should be present in the message. + // + // Users can set the processing_units field to specify the target number of + // processing units allocated to the instance. + // + // This may be zero in API responses for instances that are not yet in state + // `READY`. // // See [the // documentation](https://cloud.google.com/spanner/docs/compute-capacity) // for more information about nodes and processing units. int32 processing_units = 9; + // Optional. The autoscaling configuration. Autoscaling is enabled if this + // field is set. When autoscaling is enabled, node_count and processing_units + // are treated as OUTPUT_ONLY fields and reflect the current compute capacity + // allocated to the instance. + AutoscalingConfig autoscaling_config = 17 + [(google.api.field_behavior) = OPTIONAL]; + // Output only. The current instance state. For // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], // the state must be either omitted or set to `CREATING`. For diff --git a/protos/google/spanner/v1/spanner.proto b/protos/google/spanner/v1/spanner.proto index 0c71e03d9..367928a45 100644 --- a/protos/google/spanner/v1/spanner.proto +++ b/protos/google/spanner/v1/spanner.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.spanner.v1; +import public "google/spanner/v1/commit_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -24,7 +26,6 @@ import "google/protobuf/empty.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import public "google/spanner/v1/commit_response.proto"; import "google/spanner/v1/keys.proto"; import "google/spanner/v1/mutation.proto"; import "google/spanner/v1/result_set.proto"; @@ -84,7 +85,8 @@ service Spanner { // // This API can be used to initialize a session cache on the clients. // See https://goo.gl/TgSFN2 for best practices on session cache management. - rpc BatchCreateSessions(BatchCreateSessionsRequest) returns (BatchCreateSessionsResponse) { + rpc BatchCreateSessions(BatchCreateSessionsRequest) + returns (BatchCreateSessionsResponse) { option (google.api.http) = { post: "/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate" body: "*" @@ -127,10 +129,12 @@ service Spanner { // // Operations inside read-write transactions might return `ABORTED`. If // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. // // Larger result sets can be fetched in streaming fashion by calling - // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + // instead. rpc ExecuteSql(ExecuteSqlRequest) returns (ResultSet) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql" @@ -138,11 +142,11 @@ service Spanner { }; } - // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result - // set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there - // is no limit on the size of the returned result set. However, no - // individual row in the result set can exceed 100 MiB, and no - // column value can exceed 10 MiB. + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + // result set as a stream. Unlike + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on + // the size of the returned result set. However, no individual row in the + // result set can exceed 100 MiB, and no column value can exceed 10 MiB. rpc ExecuteStreamingSql(ExecuteSqlRequest) returns (stream PartialResultSet) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql" @@ -155,13 +159,15 @@ service Spanner { // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. // // Statements are executed in sequential order. A request can succeed even if - // a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the - // response provides information about the statement that failed. Clients must - // inspect this field to determine whether an error occurred. + // a statement fails. The + // [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + // field in the response provides information about the statement that failed. + // Clients must inspect this field to determine whether an error occurred. // // Execution stops after the first failed statement; the remaining statements // are not executed. - rpc ExecuteBatchDml(ExecuteBatchDmlRequest) returns (ExecuteBatchDmlResponse) { + rpc ExecuteBatchDml(ExecuteBatchDmlRequest) + returns (ExecuteBatchDmlResponse) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml" body: "*" @@ -170,14 +176,15 @@ service Spanner { // Reads rows from the database using key lookups and scans, as a // simple key/value style alternative to - // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to - // return a result set larger than 10 MiB; if the read matches more + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be + // used to return a result set larger than 10 MiB; if the read matches more // data than that, the read fails with a `FAILED_PRECONDITION` // error. // // Reads inside read-write transactions might return `ABORTED`. If // this occurs, the application should restart the transaction from - // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more + // details. // // Larger result sets can be yielded in streaming fashion by calling // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. @@ -188,9 +195,9 @@ service Spanner { }; } - // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a - // stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the - // size of the returned result set. However, no individual row in + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + // as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no + // limit on the size of the returned result set. However, no individual row in // the result set can exceed 100 MiB, and no column value can exceed // 10 MiB. rpc StreamingRead(ReadRequest) returns (stream PartialResultSet) { @@ -201,7 +208,8 @@ service Spanner { } // Begins a new transaction. This step can often be skipped: - // [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a // side-effect. rpc BeginTransaction(BeginTransactionRequest) returns (Transaction) { @@ -232,13 +240,15 @@ service Spanner { body: "*" }; option (google.api.method_signature) = "session,transaction_id,mutations"; - option (google.api.method_signature) = "session,single_use_transaction,mutations"; + option (google.api.method_signature) = + "session,single_use_transaction,mutations"; } // Rolls back a transaction, releasing any locks it holds. It is a good // idea to call this for any transaction that includes one or more - // [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and - // ultimately decides not to commit. + // [Read][google.spanner.v1.Spanner.Read] or + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + // decides not to commit. // // `Rollback` returns `OK` if it successfully aborts the transaction, the // transaction was already aborted, or the transaction is not @@ -253,10 +263,11 @@ service Spanner { // Creates a set of partition tokens that can be used to execute a query // operation in parallel. Each of the returned partition tokens can be used - // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset - // of the query result to read. The same session and read-only transaction - // must be used by the PartitionQueryRequest used to create the - // partition tokens and the ExecuteSqlRequests that use the partition tokens. + // by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + // specify a subset of the query result to read. The same session and + // read-only transaction must be used by the PartitionQueryRequest used to + // create the partition tokens and the ExecuteSqlRequests that use the + // partition tokens. // // Partition tokens become invalid when the session used to create them // is deleted, is idle for too long, begins a new transaction, or becomes too @@ -271,12 +282,13 @@ service Spanner { // Creates a set of partition tokens that can be used to execute a read // operation in parallel. Each of the returned partition tokens can be used - // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read - // result to read. The same session and read-only transaction must be used by - // the PartitionReadRequest used to create the partition tokens and the - // ReadRequests that use the partition tokens. There are no ordering - // guarantees on rows returned among the returned partition tokens, or even - // within each individual StreamingRead call issued with a partition_token. + // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a + // subset of the read result to read. The same session and read-only + // transaction must be used by the PartitionReadRequest used to create the + // partition tokens and the ReadRequests that use the partition tokens. There + // are no ordering guarantees on rows returned among the returned partition + // tokens, or even within each individual StreamingRead call issued with a + // partition_token. // // Partition tokens become invalid when the session used to create them // is deleted, is idle for too long, begins a new transaction, or becomes too @@ -288,6 +300,29 @@ service Spanner { body: "*" }; } + + // Batches the supplied mutation groups in a collection of efficient + // transactions. All mutations in a group are committed atomically. However, + // mutations across groups can be committed non-atomically in an unspecified + // order and thus, they must be independent of each other. Partial failure is + // possible, i.e., some groups may have been committed successfully, while + // some may have failed. The results of individual batches are streamed into + // the response as the batches are applied. + // + // BatchWrite requests are not replay protected, meaning that each mutation + // group may be applied more than once. Replays of non-idempotent mutations + // may have undesirable effects. For example, replays of an insert mutation + // may produce an already exists error or if you use generated or commit + // timestamp-based keys, it may result in additional rows being added to the + // mutation's table. We recommend structuring your mutation groups to be + // idempotent to avoid this issue. + rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) { + option (google.api.http) = { + post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite" + body: "*" + }; + option (google.api.method_signature) = "session,mutation_groups"; + } } // The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. @@ -304,7 +339,8 @@ message CreateSessionRequest { Session session = 2 [(google.api.field_behavior) = REQUIRED]; } -// The request for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +// The request for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. message BatchCreateSessionsRequest { // Required. The database in which the new sessions are created. string database = 1 [ @@ -321,11 +357,13 @@ message BatchCreateSessionsRequest { // The API may return fewer than the requested number of sessions. If a // specific number of sessions are desired, the client can make additional // calls to BatchCreateSessions (adjusting - // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + // as necessary). int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; } -// The response for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. +// The response for +// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. message BatchCreateSessionsResponse { // The freshly created sessions. repeated Session session = 1; @@ -353,11 +391,13 @@ message Session { map labels = 2; // Output only. The timestamp when the session is created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The approximate timestamp when the session is last used. It is // typically earlier than the actual last use time. - google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp approximate_last_use_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The database role which created this session. string creator_role = 5; @@ -368,9 +408,7 @@ message GetSessionRequest { // Required. The name of the session to retrieve. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; } @@ -389,7 +427,8 @@ message ListSessionsRequest { int32 page_size = 2; // If non-empty, `page_token` should contain a - // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + // from a previous // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. string page_token = 3; @@ -412,8 +451,8 @@ message ListSessionsResponse { repeated Session sessions = 1; // `next_page_token` can be sent in a subsequent - // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - // sessions. + // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + // of the matching sessions. string next_page_token = 2; } @@ -422,9 +461,7 @@ message DeleteSessionRequest { // Required. The name of the session to delete. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; } @@ -489,6 +526,86 @@ message RequestOptions { string transaction_tag = 3; } +// The DirectedReadOptions can be used to indicate which replicas or regions +// should be used for non-transactional reads or queries. +// +// DirectedReadOptions may only be specified for a read-only transaction, +// otherwise the API will return an `INVALID_ARGUMENT` error. +message DirectedReadOptions { + // The directed read replica selector. + // Callers must provide one or more of the following fields for replica + // selection: + // + // * `location` - The location must be one of the regions within the + // multi-region configuration of your database. + // * `type` - The type of the replica. + // + // Some examples of using replica_selectors are: + // + // * `location:us-east1` --> The "us-east1" replica(s) of any available type + // will be used to process the request. + // * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest + // . available location will be used to process the + // request. + // * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + // in location "us-east1" will be used to process + // the request. + message ReplicaSelection { + // Indicates the type of replica. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Read-write replicas support both reads and writes. + READ_WRITE = 1; + + // Read-only replicas only support reads (not writes). + READ_ONLY = 2; + } + + // The location or region of the serving requests, e.g. "us-east1". + string location = 1; + + // The type of replica. + Type type = 2; + } + + // An IncludeReplicas contains a repeated set of ReplicaSelection which + // indicates the order in which replicas should be considered. + message IncludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + + // If true, Spanner will not route requests to a replica outside the + // include_replicas list when all of the specified replicas are unavailable + // or unhealthy. Default value is `false`. + bool auto_failover_disabled = 2; + } + + // An ExcludeReplicas contains a repeated set of ReplicaSelection that should + // be excluded from serving requests. + message ExcludeReplicas { + // The directed read replica selector. + repeated ReplicaSelection replica_selections = 1; + } + + // Required. Replicas indicates the order in which replicas should be + // considered. At most one of either include_replicas or exclude_replicas + // should be present in the message. + oneof replicas { + // Include_replicas indicates the order of replicas (as they appear in + // this list) to process the request. If auto_failover_disabled is set to + // true and all replicas are exhausted without finding a healthy replica, + // Spanner will wait for a replica in the list to become available, requests + // may fail due to `DEADLINE_EXCEEDED` errors. + IncludeReplicas include_replicas = 1; + + // Exclude_replicas indicates that should be excluded from serving + // requests. Spanner will not route requests to the replicas in this list. + ExcludeReplicas exclude_replicas = 2; + } +} + // The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. message ExecuteSqlRequest { @@ -562,9 +679,7 @@ message ExecuteSqlRequest { // Required. The session in which the SQL query should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // The transaction to use. @@ -599,7 +714,8 @@ message ExecuteSqlRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL statement parameters. See the @@ -609,15 +725,18 @@ message ExecuteSqlRequest { // If this request is resuming a previously interrupted SQL statement // execution, `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - // enables the new SQL statement execution to resume where the last one left - // off. The rest of the request parameters must exactly match the - // request that yielded this token. + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new SQL statement execution to resume + // where the last one left off. The rest of the request parameters must + // exactly match the request that yielded this token. bytes resume_token = 6; // Used to control the amount of debugging information returned in - // [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - // be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + // [ResultSetStats][google.spanner.v1.ResultSetStats]. If + // [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + // set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + // be set to + // [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. QueryMode query_mode = 7; // If present, results will be restricted to the specified partition @@ -644,11 +763,14 @@ message ExecuteSqlRequest { // Common options for this request. RequestOptions request_options = 11; + // Directed read options for this request. + DirectedReadOptions directed_read_options = 15; + // If this is for a partitioned query and this field is set to `true`, the - // request will be executed via Spanner independent compute resources. + // request is executed with Spanner Data Boost independent compute resources. // // If the field is set to `true` but the request does not set - // `partition_token`, the API will return an `INVALID_ARGUMENT` error. + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. bool data_boost_enabled = 16; } @@ -675,7 +797,9 @@ message ExecuteBatchDmlRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + // JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL statement parameters. See the @@ -687,9 +811,7 @@ message ExecuteBatchDmlRequest { // Required. The session in which the DML statements should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction to use. Must be a read-write transaction. @@ -699,17 +821,17 @@ message ExecuteBatchDmlRequest { // transaction. TransactionSelector transaction = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The list of statements to execute in this batch. Statements are executed - // serially, such that the effects of statement `i` are visible to statement - // `i+1`. Each statement must be a DML statement. Execution stops at the - // first failed statement; the remaining statements are not executed. + // Required. The list of statements to execute in this batch. Statements are + // executed serially, such that the effects of statement `i` are visible to + // statement `i+1`. Each statement must be a DML statement. Execution stops at + // the first failed statement; the remaining statements are not executed. // // Callers must provide at least one statement. repeated Statement statements = 3 [(google.api.field_behavior) = REQUIRED]; - // Required. A per-transaction sequence number used to identify this request. This field - // makes each request idempotent such that if the request is received multiple - // times, at most one will succeed. + // Required. A per-transaction sequence number used to identify this request. + // This field makes each request idempotent such that if the request is + // received multiple times, at most one will succeed. // // The sequence number must be monotonically increasing within the // transaction. If a request arrives for the first time with an out-of-order @@ -721,38 +843,47 @@ message ExecuteBatchDmlRequest { RequestOptions request_options = 5; } -// The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list -// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML statement that has successfully -// executed, in the same order as the statements in the request. If a statement -// fails, the status in the response body identifies the cause of the failure. +// The response for +// [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list +// of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML +// statement that has successfully executed, in the same order as the statements +// in the request. If a statement fails, the status in the response body +// identifies the cause of the failure. // // To check for DML statements that failed, use the following approach: // -// 1. Check the status in the response message. The [google.rpc.Code][google.rpc.Code] enum +// 1. Check the status in the response message. The +// [google.rpc.Code][google.rpc.Code] enum // value `OK` indicates that all statements were executed successfully. // 2. If the status was not `OK`, check the number of result sets in the -// response. If the response contains `N` [ResultSet][google.spanner.v1.ResultSet] messages, then -// statement `N+1` in the request failed. +// response. If the response contains `N` +// [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in +// the request failed. // // Example 1: // // * Request: 5 DML statements, all executed successfully. -// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the status `OK`. +// * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the +// status `OK`. // // Example 2: // // * Request: 5 DML statements. The third statement has a syntax error. -// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax error (`INVALID_ARGUMENT`) -// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages indicates that the third -// statement failed, and the fourth and fifth statements were not executed. +// * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax +// error (`INVALID_ARGUMENT`) +// status. The number of [ResultSet][google.spanner.v1.ResultSet] messages +// indicates that the third statement failed, and the fourth and fifth +// statements were not executed. message ExecuteBatchDmlResponse { - // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - // in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - // not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - // the number of rows modified by the statement. + // One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + // request that ran successfully, in the same order as the statements in the + // request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + // rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + // [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + // modified by the statement. // - // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - // [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + // Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + // contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. repeated ResultSet result_sets = 1; // If all DML statements are executed successfully, the status is `OK`. @@ -787,24 +918,23 @@ message PartitionQueryRequest { // Required. The session used to create the partitions. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Read only snapshot transactions are supported, read/write and single use // transactions are not. TransactionSelector transaction = 2; - // Required. The query request to generate partitions for. The request will fail if - // the query is not root partitionable. The query plan of a root - // partitionable query has a single distributed union operator. A distributed - // union operator conceptually divides one or more tables into multiple - // splits, remotely evaluates a subquery independently on each split, and - // then unions all results. + // Required. The query request to generate partitions for. The request will + // fail if the query is not root partitionable. For a query to be root + // partitionable, it needs to satisfy a few conditions. For example, the first + // operator in the query execution plan must be a distributed union operator. + // For more information about other conditions, see [Read data in + // parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). // - // This must not contain DML commands, such as INSERT, UPDATE, or - // DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + // The query request must not contain DML commands, such as INSERT, UPDATE, or + // DELETE. Use + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a // PartitionedDml transaction for large, partition-friendly DML operations. string sql = 3 [(google.api.field_behavior) = REQUIRED]; @@ -824,7 +954,8 @@ message PartitionQueryRequest { // It is not always possible for Cloud Spanner to infer the right SQL type // from a JSON value. For example, values of type `BYTES` and values - // of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + // of type `STRING` both appear in + // [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact // SQL type for some or all of the SQL query parameters. See the @@ -841,9 +972,7 @@ message PartitionReadRequest { // Required. The session used to create the partitions. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Read only snapshot transactions are supported, read/write and single use @@ -853,18 +982,24 @@ message PartitionReadRequest { // Required. The name of the table in the database to be read. string table = 3 [(google.api.field_behavior) = REQUIRED]; - // If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - // used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - // and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + // If non-empty, the name of an index on + // [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + // instead of the table primary key when interpreting + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + // result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + // for further information. string index = 4; - // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - // this request. + // The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + // returned for each row matching this request. repeated string columns = 5; // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - // is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + // primary keys of the rows in + // [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + // [index][google.spanner.v1.PartitionReadRequest.index] is present. If + // [index][google.spanner.v1.PartitionReadRequest.index] is present, then + // [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names // index keys in [index][google.spanner.v1.PartitionReadRequest.index]. // // It is not an error for the `key_set` to name rows that do not @@ -900,9 +1035,7 @@ message ReadRequest { // Required. The session in which the read should be performed. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // The transaction to use. If none is provided, the default is a @@ -912,24 +1045,31 @@ message ReadRequest { // Required. The name of the table in the database to be read. string table = 3 [(google.api.field_behavior) = REQUIRED]; - // If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - // used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - // and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + // If non-empty, the name of an index on + // [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + // the table primary key when interpreting + // [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + // See [key_set][google.spanner.v1.ReadRequest.key_set] for further + // information. string index = 4; - // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - // this request. + // Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + // returned for each row matching this request. repeated string columns = 5 [(google.api.field_behavior) = REQUIRED]; // Required. `key_set` identifies the rows to be yielded. `key_set` names the - // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - // is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - // index keys in [index][google.spanner.v1.ReadRequest.index]. + // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + // be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + // If [index][google.spanner.v1.ReadRequest.index] is present, then + // [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + // in [index][google.spanner.v1.ReadRequest.index]. // - // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - // in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - // empty, rows will be yielded in an unspecified order. + // If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + // field is empty, rows are yielded in table primary key order (if + // [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + // (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + // [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + // not empty, rows will be yielded in an unspecified order. // // It is not an error for the `key_set` to name rows that do not // exist in the database. Read yields nothing for nonexistent rows. @@ -942,9 +1082,9 @@ message ReadRequest { // If this request is resuming a previously interrupted read, // `resume_token` should be copied from the last - // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - // enables the new read to resume where the last read left off. The - // rest of the request parameters must exactly match the request + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + // interruption. Doing this enables the new read to resume where the last read + // left off. The rest of the request parameters must exactly match the request // that yielded this token. bytes resume_token = 9; @@ -957,22 +1097,24 @@ message ReadRequest { // Common options for this request. RequestOptions request_options = 11; + // Directed read options for this request. + DirectedReadOptions directed_read_options = 14; + // If this is for a partitioned read and this field is set to `true`, the - // request will be executed via Spanner independent compute resources. + // request is executed with Spanner Data Boost independent compute resources. // // If the field is set to `true` but the request does not set - // `partition_token`, the API will return an `INVALID_ARGUMENT` error. + // `partition_token`, the API returns an `INVALID_ARGUMENT` error. bool data_boost_enabled = 15; } -// The request for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. +// The request for +// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. message BeginTransactionRequest { // Required. The session in which the transaction runs. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. Options for the new transaction. @@ -991,9 +1133,7 @@ message CommitRequest { // Required. The session in which the transaction to be committed is running. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction in which to commit. @@ -1019,8 +1159,8 @@ message CommitRequest { repeated Mutation mutations = 4; // If `true`, then statistics related to the transaction will be included in - // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is - // `false`. + // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. + // Default value is `false`. bool return_commit_stats = 5; // Common options for this request. @@ -1032,11 +1172,47 @@ message RollbackRequest { // Required. The session in which the transaction to roll back is running. string session = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "spanner.googleapis.com/Session" - } + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } ]; // Required. The transaction to roll back. bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED]; } + +// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. +message BatchWriteRequest { + // A group of mutations to be committed together. Related mutations should be + // placed in a group. For example, two mutations inserting rows with the same + // primary key prefix in both parent and child tables are related. + message MutationGroup { + // Required. The mutations in this group. + repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The session in which the batch request is to be run. + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "spanner.googleapis.com/Session" } + ]; + + // Common options for this request. + RequestOptions request_options = 3; + + // Required. The groups of mutations to be applied. + repeated MutationGroup mutation_groups = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// The result of applying a batch of mutations. +message BatchWriteResponse { + // The mutation groups applied in this batch. The values index into the + // `mutation_groups` field in the corresponding `BatchWriteRequest`. + repeated int32 indexes = 1; + + // An `OK` status indicates success. Any other status indicates a failure. + google.rpc.Status status = 2; + + // The commit timestamp of the transaction that applied this batch. + // Present if `status` is `OK`, absent otherwise. + google.protobuf.Timestamp commit_timestamp = 3; +} diff --git a/protos/google/spanner/v1/type.proto b/protos/google/spanner/v1/type.proto index 290b5540d..412cfa126 100644 --- a/protos/google/spanner/v1/type.proto +++ b/protos/google/spanner/v1/type.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -171,4 +171,9 @@ enum TypeAnnotationCode { // [JSON][google.spanner.v1.TypeCode.JSON] when a client interacts with PostgreSQL-enabled // Spanner databases. PG_JSONB = 3; + + // PostgreSQL compatible OID type. This annotation can be used by a client + // interacting with PostgreSQL-enabled Spanner database to specify that a + // value should be treated using the semantics of the OID type. + PG_OID = 4; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 98af6928c..99ec6fff4 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -760,6 +760,15 @@ export namespace google { /** 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. */ @@ -774,6 +783,15 @@ export namespace google { /** 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 @@ -852,6 +870,136 @@ export namespace google { 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 { @@ -1779,6 +1927,9 @@ export namespace google { /** FileOptions rubyPackage */ rubyPackage?: (string|null); + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -1855,6 +2006,9 @@ export namespace google { /** FileOptions rubyPackage. */ public rubyPackage: string; + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -1964,6 +2118,9 @@ export namespace google { /** MessageOptions deprecatedLegacyJsonFieldConflicts */ deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -1995,6 +2152,9 @@ export namespace google { /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ public deprecatedLegacyJsonFieldConflicts: boolean; + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2106,8 +2266,14 @@ export namespace google { /** FieldOptions retention */ retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - /** FieldOptions target */ - target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -2155,8 +2321,14 @@ export namespace google { /** FieldOptions retention. */ public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - /** FieldOptions target. */ - public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + /** 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 uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2275,11 +2447,117 @@ export namespace google { TARGET_TYPE_SERVICE = 8, TARGET_TYPE_METHOD = 9 } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (string|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: string; + + /** 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 an OneofOptions. */ interface IOneofOptions { + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** OneofOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2293,6 +2571,9 @@ export namespace google { */ constructor(properties?: google.protobuf.IOneofOptions); + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** OneofOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2386,6 +2667,9 @@ export namespace google { /** EnumOptions deprecatedLegacyJsonFieldConflicts */ deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2408,6 +2692,9 @@ export namespace google { /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ public deprecatedLegacyJsonFieldConflicts: boolean; + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2495,6 +2782,12 @@ export namespace google { /** EnumValueOptions deprecated */ deprecated?: (boolean|null); + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2511,6 +2804,12 @@ export namespace google { /** EnumValueOptions deprecated. */ public deprecated: boolean; + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2595,6 +2894,9 @@ export namespace google { /** Properties of a ServiceOptions. */ interface IServiceOptions { + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated */ deprecated?: (boolean|null); @@ -2617,6 +2919,9 @@ export namespace google { */ constructor(properties?: google.protobuf.IServiceOptions); + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated. */ public deprecated: boolean; @@ -2710,6 +3015,9 @@ export namespace google { /** 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); @@ -2738,6 +3046,9 @@ export namespace google { /** 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[]; @@ -3068,141 +3379,321 @@ export namespace google { } } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** Properties of a FeatureSet. */ + interface IFeatureSet { - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** 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 stringFieldValidation */ + stringFieldValidation?: (google.protobuf.FeatureSet.StringFieldValidation|keyof typeof google.protobuf.FeatureSet.StringFieldValidation|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 rawFeatures */ + rawFeatures?: (google.protobuf.IFeatureSet|null); } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { /** - * Constructs a new SourceCodeInfo. + * Constructs a new FeatureSet. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + constructor(properties?: google.protobuf.IFeatureSet); - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** 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 stringFieldValidation. */ + public stringFieldValidation: (google.protobuf.FeatureSet.StringFieldValidation|keyof typeof google.protobuf.FeatureSet.StringFieldValidation); + + /** 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 rawFeatures. */ + public rawFeatures?: (google.protobuf.IFeatureSet|null); /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns FeatureSet instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFeatureSet, 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 + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * 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 SourceCodeInfo + * @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.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @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.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; /** - * Verifies a SourceCodeInfo message. + * 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns FeatureSet */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * 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.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this FeatureSet to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SourceCodeInfo + * 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 SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { + namespace FeatureSet { - /** Location path */ - path?: (number[]|null); + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } - /** Location span */ - span?: (number[]|null); + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } - /** Location leadingComments */ - leadingComments?: (string|null); + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } - /** Location trailingComments */ - trailingComments?: (string|null); + /** StringFieldValidation enum. */ + enum StringFieldValidation { + STRING_FIELD_VALIDATION_UNKNOWN = 0, + MANDATORY = 1, + HINT = 2, + NONE = 3 + } - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 } - /** Represents a Location. */ - class Location implements ILocation { + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** Location path. */ - public path: number[]; + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } - /** Location span. */ - public span: number[]; + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { - /** Location leadingComments. */ - public leadingComments: string; + /** + * 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; @@ -11690,6 +12181,336 @@ export namespace google { } } + /** Properties of an AutoscalingConfig. */ + interface IAutoscalingConfig { + + /** AutoscalingConfig autoscalingLimits */ + autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets */ + autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + } + + /** Represents an AutoscalingConfig. */ + class AutoscalingConfig implements IAutoscalingConfig { + + /** + * Constructs a new AutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig); + + /** AutoscalingConfig autoscalingLimits. */ + public autoscalingLimits?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null); + + /** AutoscalingConfig autoscalingTargets. */ + public autoscalingTargets?: (google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null); + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfig instance + */ + public static create(properties?: google.spanner.admin.instance.v1.IAutoscalingConfig): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Verifies an AutoscalingConfig message. + * @param message Plain 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 AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @param message AutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoscalingConfig { + + /** Properties of an AutoscalingLimits. */ + interface IAutoscalingLimits { + + /** AutoscalingLimits minNodes */ + minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits */ + minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes */ + maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits */ + maxProcessingUnits?: (number|null); + } + + /** Represents an AutoscalingLimits. */ + class AutoscalingLimits implements IAutoscalingLimits { + + /** + * Constructs a new AutoscalingLimits. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits); + + /** AutoscalingLimits minNodes. */ + public minNodes?: (number|null); + + /** AutoscalingLimits minProcessingUnits. */ + public minProcessingUnits?: (number|null); + + /** AutoscalingLimits maxNodes. */ + public maxNodes?: (number|null); + + /** AutoscalingLimits maxProcessingUnits. */ + public maxProcessingUnits?: (number|null); + + /** AutoscalingLimits minLimit. */ + public minLimit?: ("minNodes"|"minProcessingUnits"); + + /** AutoscalingLimits maxLimit. */ + public maxLimit?: ("maxNodes"|"maxProcessingUnits"); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingLimits instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @param message AutoscalingLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Verifies an AutoscalingLimits message. + * @param message Plain 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 AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingLimits + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @param message AutoscalingLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingTargets. */ + interface IAutoscalingTargets { + + /** AutoscalingTargets highPriorityCpuUtilizationPercent */ + highPriorityCpuUtilizationPercent?: (number|null); + + /** AutoscalingTargets storageUtilizationPercent */ + storageUtilizationPercent?: (number|null); + } + + /** Represents an AutoscalingTargets. */ + class AutoscalingTargets implements IAutoscalingTargets { + + /** + * Constructs a new AutoscalingTargets. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets); + + /** AutoscalingTargets highPriorityCpuUtilizationPercent. */ + public highPriorityCpuUtilizationPercent: number; + + /** AutoscalingTargets storageUtilizationPercent. */ + public storageUtilizationPercent: number; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingTargets instance + */ + public static create(properties?: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @param message AutoscalingTargets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Verifies an AutoscalingTargets message. + * @param message Plain 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 AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingTargets + */ + public static fromObject(object: { [k: string]: any }): google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @param message AutoscalingTargets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingTargets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingTargets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an Instance. */ interface IInstance { @@ -11708,6 +12529,9 @@ export namespace google { /** Instance processingUnits */ processingUnits?: (number|null); + /** Instance autoscalingConfig */ + autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + /** Instance state */ state?: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State|null); @@ -11748,6 +12572,9 @@ export namespace google { /** Instance processingUnits. */ public processingUnits: number; + /** Instance autoscalingConfig. */ + public autoscalingConfig?: (google.spanner.admin.instance.v1.IAutoscalingConfig|null); + /** Instance state. */ public state: (google.spanner.admin.instance.v1.Instance.State|keyof typeof google.spanner.admin.instance.v1.Instance.State); @@ -16472,7 +17299,8 @@ export namespace google { enum TypeAnnotationCode { TYPE_ANNOTATION_CODE_UNSPECIFIED = 0, PG_NUMERIC = 2, - PG_JSONB = 3 + PG_JSONB = 3, + PG_OID = 4 } /** Represents a Spanner */ @@ -16704,6 +17532,20 @@ export namespace google { * @returns Promise */ public partitionRead(request: google.spanner.v1.IPartitionReadRequest): Promise; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchWriteResponse + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest, callback: google.spanner.v1.Spanner.BatchWriteCallback): void; + + /** + * Calls BatchWrite. + * @param request BatchWriteRequest message or plain object + * @returns Promise + */ + public batchWrite(request: google.spanner.v1.IBatchWriteRequest): Promise; } namespace Spanner { @@ -16812,6 +17654,13 @@ export namespace google { * @param [response] PartitionResponse */ type PartitionReadCallback = (error: (Error|null), response?: google.spanner.v1.PartitionResponse) => void; + + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @param error Error, if any + * @param [response] BatchWriteResponse + */ + type BatchWriteCallback = (error: (Error|null), response?: google.spanner.v1.BatchWriteResponse) => void; } /** Properties of a CreateSessionRequest. */ @@ -17757,22 +18606,444 @@ export namespace google { */ public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for RequestOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for RequestOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RequestOptions { + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + PRIORITY_LOW = 1, + PRIORITY_MEDIUM = 2, + PRIORITY_HIGH = 3 + } + } + + /** Properties of a DirectedReadOptions. */ + interface IDirectedReadOptions { + + /** DirectedReadOptions includeReplicas */ + includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas */ + excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + } + + /** Represents a DirectedReadOptions. */ + class DirectedReadOptions implements IDirectedReadOptions { + + /** + * Constructs a new DirectedReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IDirectedReadOptions); + + /** DirectedReadOptions includeReplicas. */ + public includeReplicas?: (google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null); + + /** DirectedReadOptions excludeReplicas. */ + public excludeReplicas?: (google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null); + + /** DirectedReadOptions replicas. */ + public replicas?: ("includeReplicas"|"excludeReplicas"); + + /** + * Creates a new DirectedReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DirectedReadOptions instance + */ + public static create(properties?: google.spanner.v1.IDirectedReadOptions): google.spanner.v1.DirectedReadOptions; + + /** + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. + * @param message DirectedReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IDirectedReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions; + + /** + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DirectedReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions; + + /** + * Verifies a DirectedReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DirectedReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions; + + /** + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. + * @param message DirectedReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DirectedReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DirectedReadOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DirectedReadOptions { + + /** Properties of a ReplicaSelection. */ + interface IReplicaSelection { + + /** ReplicaSelection location */ + location?: (string|null); + + /** ReplicaSelection type */ + type?: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null); + } + + /** Represents a ReplicaSelection. */ + class ReplicaSelection implements IReplicaSelection { + + /** + * Constructs a new ReplicaSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection); + + /** ReplicaSelection location. */ + public location: string; + + /** ReplicaSelection type. */ + public type: (google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|keyof typeof google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type); + + /** + * Creates a new ReplicaSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicaSelection instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IReplicaSelection): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. + * @param message ReplicaSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IReplicaSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicaSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Verifies a ReplicaSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicaSelection + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ReplicaSelection; + + /** + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. + * @param message ReplicaSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ReplicaSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicaSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicaSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplicaSelection { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2 + } + } + + /** Properties of an IncludeReplicas. */ + interface IIncludeReplicas { + + /** IncludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + + /** IncludeReplicas autoFailoverDisabled */ + autoFailoverDisabled?: (boolean|null); + } + + /** Represents an IncludeReplicas. */ + class IncludeReplicas implements IIncludeReplicas { + + /** + * Constructs a new IncludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas); + + /** IncludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** IncludeReplicas autoFailoverDisabled. */ + public autoFailoverDisabled: boolean; + + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns IncludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IIncludeReplicas): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @param message IncludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IIncludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Verifies an IncludeReplicas message. + * @param message Plain 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 IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.IncludeReplicas; + + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @param message IncludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.IncludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExcludeReplicas. */ + interface IExcludeReplicas { + + /** ExcludeReplicas replicaSelections */ + replicaSelections?: (google.spanner.v1.DirectedReadOptions.IReplicaSelection[]|null); + } + + /** Represents an ExcludeReplicas. */ + class ExcludeReplicas implements IExcludeReplicas { + + /** + * Constructs a new ExcludeReplicas. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas); + + /** ExcludeReplicas replicaSelections. */ + public replicaSelections: google.spanner.v1.DirectedReadOptions.IReplicaSelection[]; + + /** + * Creates a new ExcludeReplicas instance using the specified properties. + * @param [properties] Properties to set + * @returns ExcludeReplicas instance + */ + public static create(properties?: google.spanner.v1.DirectedReadOptions.IExcludeReplicas): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. + * @param message ExcludeReplicas message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.DirectedReadOptions.IExcludeReplicas, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExcludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; + + /** + * Verifies an ExcludeReplicas message. + * @param message Plain 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 ExcludeReplicas message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExcludeReplicas + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.DirectedReadOptions.ExcludeReplicas; - namespace RequestOptions { + /** + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. + * @param message ExcludeReplicas + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.DirectedReadOptions.ExcludeReplicas, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Priority enum. */ - enum Priority { - PRIORITY_UNSPECIFIED = 0, - PRIORITY_LOW = 1, - PRIORITY_MEDIUM = 2, - PRIORITY_HIGH = 3 + /** + * Converts this ExcludeReplicas to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExcludeReplicas + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -17812,6 +19083,9 @@ export namespace google { /** ExecuteSqlRequest requestOptions */ requestOptions?: (google.spanner.v1.IRequestOptions|null); + /** ExecuteSqlRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + /** ExecuteSqlRequest dataBoostEnabled */ dataBoostEnabled?: (boolean|null); } @@ -17858,6 +19132,9 @@ export namespace google { /** ExecuteSqlRequest requestOptions. */ public requestOptions?: (google.spanner.v1.IRequestOptions|null); + /** ExecuteSqlRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + /** ExecuteSqlRequest dataBoostEnabled. */ public dataBoostEnabled: boolean; @@ -18984,6 +20261,9 @@ export namespace google { /** ReadRequest requestOptions */ requestOptions?: (google.spanner.v1.IRequestOptions|null); + /** ReadRequest directedReadOptions */ + directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + /** ReadRequest dataBoostEnabled */ dataBoostEnabled?: (boolean|null); } @@ -19027,6 +20307,9 @@ export namespace google { /** ReadRequest requestOptions. */ public requestOptions?: (google.spanner.v1.IRequestOptions|null); + /** ReadRequest directedReadOptions. */ + public directedReadOptions?: (google.spanner.v1.IDirectedReadOptions|null); + /** ReadRequest dataBoostEnabled. */ public dataBoostEnabled: boolean; @@ -19449,6 +20732,324 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a BatchWriteRequest. */ + interface IBatchWriteRequest { + + /** BatchWriteRequest session */ + session?: (string|null); + + /** BatchWriteRequest requestOptions */ + requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups */ + mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null); + } + + /** Represents a BatchWriteRequest. */ + class BatchWriteRequest implements IBatchWriteRequest { + + /** + * Constructs a new BatchWriteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteRequest); + + /** BatchWriteRequest session. */ + public session: string; + + /** BatchWriteRequest requestOptions. */ + public requestOptions?: (google.spanner.v1.IRequestOptions|null); + + /** BatchWriteRequest mutationGroups. */ + public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[]; + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteRequest instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteRequest): google.spanner.v1.BatchWriteRequest; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest; + + /** + * Verifies a BatchWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteRequest + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest; + + /** + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. + * @param message BatchWriteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchWriteRequest { + + /** Properties of a MutationGroup. */ + interface IMutationGroup { + + /** MutationGroup mutations */ + mutations?: (google.spanner.v1.IMutation[]|null); + } + + /** Represents a MutationGroup. */ + class MutationGroup implements IMutationGroup { + + /** + * Constructs a new MutationGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup); + + /** MutationGroup mutations. */ + public mutations: google.spanner.v1.IMutation[]; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationGroup instance + */ + public static create(properties?: google.spanner.v1.BatchWriteRequest.IMutationGroup): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @param message MutationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.BatchWriteRequest.IMutationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Verifies a MutationGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationGroup + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteRequest.MutationGroup; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @param message MutationGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteRequest.MutationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutationGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchWriteResponse. */ + interface IBatchWriteResponse { + + /** BatchWriteResponse indexes */ + indexes?: (number[]|null); + + /** BatchWriteResponse status */ + status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp */ + commitTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchWriteResponse. */ + class BatchWriteResponse implements IBatchWriteResponse { + + /** + * Constructs a new BatchWriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.v1.IBatchWriteResponse); + + /** BatchWriteResponse indexes. */ + public indexes: number[]; + + /** BatchWriteResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** BatchWriteResponse commitTimestamp. */ + public commitTimestamp?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteResponse instance + */ + public static create(properties?: google.spanner.v1.IBatchWriteResponse): google.spanner.v1.BatchWriteResponse; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.v1.BatchWriteResponse; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.v1.BatchWriteResponse; + + /** + * Verifies a BatchWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchWriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.spanner.v1.BatchWriteResponse; + + /** + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @param message BatchWriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchWriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchWriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } @@ -20368,6 +21969,9 @@ export namespace google { /** Publishing librarySettings */ librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); } /** Represents a Publishing. */ @@ -20406,6 +22010,9 @@ export namespace google { /** Publishing librarySettings. */ public librarySettings: google.api.IClientLibrarySettings[]; + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + /** * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set @@ -20986,6 +22593,21 @@ export namespace google { /** 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. */ @@ -21000,6 +22622,21 @@ export namespace google { /** 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 @@ -21499,7 +23136,10 @@ export namespace google { CLOUD = 1, ADS = 2, PHOTOS = 3, - STREET_VIEW = 4 + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 } /** ClientLibraryDestination enum. */ diff --git a/protos/protos.js b/protos/protos.js index 296c1cf64..b2ec5546f 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -2217,6 +2217,9 @@ * @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 */ /** @@ -2229,6 +2232,7 @@ */ 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) @@ -2243,6 +2247,30 @@ */ 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 @@ -2267,6 +2295,13 @@ ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + 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()).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()).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()).ldelim(); @@ -2310,6 +2345,20 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2354,6 +2403,28 @@ return "uninterpretedOption." + error; } } + if (message.declaration != null && message.hasOwnProperty("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]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } return null; }; @@ -2379,6 +2450,37 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + 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 (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; }; @@ -2395,8 +2497,23 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + 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); + } + if (message.verification != null && message.hasOwnProperty("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 && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -2431,6 +2548,316 @@ 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) + 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) { + if (!writer) + writer = $Writer.create(); + 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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("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) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + 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) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("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; })(); @@ -4760,6 +5187,7 @@ * @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 */ @@ -4941,6 +5369,14 @@ */ 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 @@ -5021,6 +5457,8 @@ 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()).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()).ldelim(); @@ -5141,6 +5579,10 @@ message.rubyPackage = reader.string(); break; } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -5254,6 +5696,11 @@ if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -5345,6 +5792,11 @@ message.phpMetadataNamespace = String(object.phpMetadataNamespace); if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); @@ -5406,6 +5858,7 @@ object.phpGenericServices = false; object.phpMetadataNamespace = ""; object.rubyPackage = ""; + object.features = null; } if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; @@ -5447,6 +5900,8 @@ object.phpMetadataNamespace = message.phpMetadataNamespace; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -5516,6 +5971,7 @@ * @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 */ @@ -5576,6 +6032,14 @@ */ 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 @@ -5626,6 +6090,8 @@ 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()).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()).ldelim(); @@ -5685,6 +6151,10 @@ message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -5745,6 +6215,11 @@ if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -5784,6 +6259,11 @@ message.mapEntry = Boolean(object.mapEntry); if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); @@ -5823,6 +6303,7 @@ object.deprecated = false; object.mapEntry = false; object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) @@ -5835,6 +6316,8 @@ object.mapEntry = message.mapEntry; if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -5889,7 +6372,9 @@ * @property {boolean|null} [weak] FieldOptions weak * @property {boolean|null} [debugRedact] FieldOptions debugRedact * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @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 @@ -5904,6 +6389,8 @@ * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; this.uninterpretedOption = []; this[".google.api.fieldBehavior"] = []; if (properties) @@ -5985,12 +6472,28 @@ FieldOptions.prototype.retention = 0; /** - * FieldOptions target. - * @member {google.protobuf.FieldOptions.OptionTargetType} target + * 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.target = 0; + FieldOptions.prototype.features = null; /** * FieldOptions uninterpretedOption. @@ -6058,8 +6561,14 @@ 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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()).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()).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()).ldelim(); @@ -6141,8 +6650,25 @@ message.retention = reader.int32(); break; } - case 18: { - message.target = reader.int32(); + 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())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } case 999: { @@ -6246,22 +6772,40 @@ case 2: break; } - if (message.target != null && message.hasOwnProperty("target")) - switch (message.target) { - default: - return "target: 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.targets != null && message.hasOwnProperty("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 && message.hasOwnProperty("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]); + if (error) + return "editionDefaults." + error; } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -6381,53 +6925,73 @@ message.retention = 2; break; } - switch (object.target) { - default: - if (typeof object.target === "number") { - message.target = object.target; - 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 (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); } - break; - case "TARGET_TYPE_UNKNOWN": - case 0: - message.target = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.target = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.target = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.target = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.target = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.target = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.target = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.target = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.target = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.target = 9; - break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) @@ -6506,6 +7070,8 @@ options = {}; var object = {}; if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; object.uninterpretedOption = []; object[".google.api.fieldBehavior"] = []; } @@ -6519,7 +7085,7 @@ object.unverifiedLazy = false; object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + object.features = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -6540,8 +7106,18 @@ object.debugRedact = message.debugRedact; if (message.retention != null && message.hasOwnProperty("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.target != null && message.hasOwnProperty("target")) - object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -6661,6 +7237,233 @@ return values; })(); + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {string|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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {string} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = ""; + + /** + * 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) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.edition); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + 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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.edition = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + if (message.value != null && message.hasOwnProperty("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) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + if (object.edition != null) + message.edition = String(object.edition); + 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) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.edition = ""; + object.value = ""; + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + 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; + })(); + return FieldOptions; })(); @@ -6670,6 +7473,7 @@ * Properties of an OneofOptions. * @memberof google.protobuf * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ @@ -6689,6 +7493,14 @@ 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 @@ -6721,6 +7533,8 @@ OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).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()).ldelim(); @@ -6758,6 +7572,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -6799,6 +7617,11 @@ OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -6823,6 +7646,11 @@ if (object instanceof $root.google.protobuf.OneofOptions) return object; var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); @@ -6851,6 +7679,10 @@ var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -6897,6 +7729,7 @@ * @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 */ @@ -6940,6 +7773,14 @@ */ 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 @@ -6978,6 +7819,8 @@ 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()).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()).ldelim(); @@ -7027,6 +7870,10 @@ message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -7077,6 +7924,11 @@ if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -7107,6 +7959,11 @@ message.deprecated = Boolean(object.deprecated); if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); @@ -7139,6 +7996,7 @@ object.allowAlias = false; object.deprecated = false; object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; } if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; @@ -7146,6 +8004,8 @@ object.deprecated = message.deprecated; if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -7190,6 +8050,8 @@ * @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 {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -7217,6 +8079,22 @@ */ 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 uninterpretedOption. * @member {Array.} uninterpretedOption @@ -7251,6 +8129,10 @@ writer = $Writer.create(); 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()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); 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()).ldelim(); @@ -7292,6 +8174,14 @@ message.deprecated = reader.bool(); break; } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -7336,6 +8226,14 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -7362,6 +8260,13 @@ var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -7390,10 +8295,17 @@ var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - if (options.defaults) + if (options.defaults) { object.deprecated = false; + object.features = null; + object.debugRedact = false; + } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -7437,6 +8349,7 @@ * 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 @@ -7459,6 +8372,14 @@ 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 @@ -7517,6 +8438,8 @@ writer = $Writer.create(); 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()).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()).ldelim(); @@ -7558,6 +8481,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 33: { message.deprecated = reader.bool(); break; @@ -7611,6 +8538,11 @@ ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; @@ -7644,6 +8576,11 @@ if (object instanceof $root.google.protobuf.ServiceOptions) return object; var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { @@ -7680,11 +8617,14 @@ object.uninterpretedOption = []; if (options.defaults) { object.deprecated = false; + object.features = null; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -7734,6 +8674,7 @@ * @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 @@ -7773,6 +8714,14 @@ */ 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 @@ -7833,6 +8782,8 @@ 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()).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()).ldelim(); @@ -7885,6 +8836,10 @@ message.idempotencyLevel = reader.int32(); break; } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -7952,6 +8907,11 @@ case 2: break; } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -8015,6 +8975,11 @@ message.idempotencyLevel = 2; break; } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); @@ -8065,6 +9030,7 @@ if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; object[".google.longrunning.operationInfo"] = null; object[".google.api.http"] = null; } @@ -8072,6 +9038,8 @@ object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -8762,6 +9730,607 @@ 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.StringFieldValidation|null} [stringFieldValidation] FeatureSet stringFieldValidation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.IFeatureSet|null} [rawFeatures] FeatureSet rawFeatures + */ + + /** + * 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) + 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 stringFieldValidation. + * @member {google.protobuf.FeatureSet.StringFieldValidation} stringFieldValidation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.stringFieldValidation = 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 rawFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} rawFeatures + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.rawFeatures = null; + + /** + * 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) { + if (!writer) + writer = $Writer.create(); + 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.stringFieldValidation != null && Object.hasOwnProperty.call(message, "stringFieldValidation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stringFieldValidation); + 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.rawFeatures != null && Object.hasOwnProperty.call(message, "rawFeatures")) + $root.google.protobuf.FeatureSet.encode(message.rawFeatures, writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.stringFieldValidation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 999: { + message.rawFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.stringFieldValidation != null && message.hasOwnProperty("stringFieldValidation")) + switch (message.stringFieldValidation) { + default: + return "stringFieldValidation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rawFeatures != null && message.hasOwnProperty("rawFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.rawFeatures); + if (error) + return "rawFeatures." + error; + } + 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) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + 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.stringFieldValidation) { + default: + if (typeof object.stringFieldValidation === "number") { + message.stringFieldValidation = object.stringFieldValidation; + break; + } + break; + case "STRING_FIELD_VALIDATION_UNKNOWN": + case 0: + message.stringFieldValidation = 0; + break; + case "MANDATORY": + case 1: + message.stringFieldValidation = 1; + break; + case "HINT": + case 2: + message.stringFieldValidation = 2; + break; + case "NONE": + case 3: + message.stringFieldValidation = 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; + } + if (object.rawFeatures != null) { + if (typeof object.rawFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSet.rawFeatures: object expected"); + message.rawFeatures = $root.google.protobuf.FeatureSet.fromObject(object.rawFeatures); + } + 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) { + if (!options) + options = {}; + 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.stringFieldValidation = options.enums === String ? "STRING_FIELD_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.rawFeatures = null; + } + if (message.fieldPresence != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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.stringFieldValidation != null && message.hasOwnProperty("stringFieldValidation")) + object.stringFieldValidation = options.enums === String ? $root.google.protobuf.FeatureSet.StringFieldValidation[message.stringFieldValidation] === undefined ? message.stringFieldValidation : $root.google.protobuf.FeatureSet.StringFieldValidation[message.stringFieldValidation] : message.stringFieldValidation; + if (message.messageEncoding != null && message.hasOwnProperty("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 && message.hasOwnProperty("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.rawFeatures != null && message.hasOwnProperty("rawFeatures")) + object.rawFeatures = $root.google.protobuf.FeatureSet.toObject(message.rawFeatures, options); + 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; + })(); + + /** + * StringFieldValidation enum. + * @name google.protobuf.FeatureSet.StringFieldValidation + * @enum {number} + * @property {number} STRING_FIELD_VALIDATION_UNKNOWN=0 STRING_FIELD_VALIDATION_UNKNOWN value + * @property {number} MANDATORY=1 MANDATORY value + * @property {number} HINT=2 HINT value + * @property {number} NONE=3 NONE value + */ + FeatureSet.StringFieldValidation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING_FIELD_VALIDATION_UNKNOWN"] = 0; + values[valuesById[1] = "MANDATORY"] = 1; + values[valuesById[2] = "HINT"] = 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; + })(); + + return FeatureSet; + })(); + protobuf.SourceCodeInfo = (function() { /** @@ -29272,6 +30841,787 @@ return InstanceConfig; })(); + v1.AutoscalingConfig = (function() { + + /** + * Properties of an AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @interface IAutoscalingConfig + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null} [autoscalingLimits] AutoscalingConfig autoscalingLimits + * @property {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null} [autoscalingTargets] AutoscalingConfig autoscalingTargets + */ + + /** + * Constructs a new AutoscalingConfig. + * @memberof google.spanner.admin.instance.v1 + * @classdesc Represents an AutoscalingConfig. + * @implements IAutoscalingConfig + * @constructor + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + */ + function AutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfig autoscalingLimits. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits|null|undefined} autoscalingLimits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingLimits = null; + + /** + * AutoscalingConfig autoscalingTargets. + * @member {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets|null|undefined} autoscalingTargets + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.autoscalingTargets = null; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig instance + */ + AutoscalingConfig.create = function create(properties) { + return new AutoscalingConfig(properties); + }; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfig message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits); + if (error) + return "autoscalingLimits." + error; + } + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets); + if (error) + return "autoscalingTargets." + error; + } + return null; + }; + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig} AutoscalingConfig + */ + AutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); + if (object.autoscalingLimits != null) { + if (typeof object.autoscalingLimits !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); + message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits); + } + if (object.autoscalingTargets != null) { + if (typeof object.autoscalingTargets !== "object") + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); + message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets); + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig} message AutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscalingLimits = null; + object.autoscalingTargets = null; + } + if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); + if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) + object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); + return object; + }; + + /** + * Converts this AutoscalingConfig to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfig + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig"; + }; + + AutoscalingConfig.AutoscalingLimits = (function() { + + /** + * Properties of an AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingLimits + * @property {number|null} [minNodes] AutoscalingLimits minNodes + * @property {number|null} [minProcessingUnits] AutoscalingLimits minProcessingUnits + * @property {number|null} [maxNodes] AutoscalingLimits maxNodes + * @property {number|null} [maxProcessingUnits] AutoscalingLimits maxProcessingUnits + */ + + /** + * Constructs a new AutoscalingLimits. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingLimits. + * @implements IAutoscalingLimits + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + */ + function AutoscalingLimits(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingLimits minNodes. + * @member {number|null|undefined} minNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minNodes = null; + + /** + * AutoscalingLimits minProcessingUnits. + * @member {number|null|undefined} minProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.minProcessingUnits = null; + + /** + * AutoscalingLimits maxNodes. + * @member {number|null|undefined} maxNodes + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxNodes = null; + + /** + * AutoscalingLimits maxProcessingUnits. + * @member {number|null|undefined} maxProcessingUnits + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + AutoscalingLimits.prototype.maxProcessingUnits = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingLimits minLimit. + * @member {"minNodes"|"minProcessingUnits"|undefined} minLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "minLimit", { + get: $util.oneOfGetter($oneOfFields = ["minNodes", "minProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingLimits maxLimit. + * @member {"maxNodes"|"maxProcessingUnits"|undefined} maxLimit + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + */ + Object.defineProperty(AutoscalingLimits.prototype, "maxLimit", { + get: $util.oneOfGetter($oneOfFields = ["maxNodes", "maxProcessingUnits"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingLimits instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits instance + */ + AutoscalingLimits.create = function create(properties) { + return new AutoscalingLimits(properties); + }; + + /** + * Encodes the specified AutoscalingLimits message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); + if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProcessingUnits); + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodes); + if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxProcessingUnits); + return writer; + }; + + /** + * Encodes the specified AutoscalingLimits message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingLimits} message AutoscalingLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minNodes = reader.int32(); + break; + } + case 2: { + message.minProcessingUnits = reader.int32(); + break; + } + case 3: { + message.maxNodes = reader.int32(); + break; + } + case 4: { + message.maxProcessingUnits = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingLimits message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingLimits.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + properties.minLimit = 1; + if (!$util.isInteger(message.minNodes)) + return "minNodes: integer expected"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + if (properties.minLimit === 1) + return "minLimit: multiple values"; + properties.minLimit = 1; + if (!$util.isInteger(message.minProcessingUnits)) + return "minProcessingUnits: integer expected"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + properties.maxLimit = 1; + if (!$util.isInteger(message.maxNodes)) + return "maxNodes: integer expected"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + if (properties.maxLimit === 1) + return "maxLimit: multiple values"; + properties.maxLimit = 1; + if (!$util.isInteger(message.maxProcessingUnits)) + return "maxProcessingUnits: integer expected"; + } + return null; + }; + + /** + * Creates an AutoscalingLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} AutoscalingLimits + */ + AutoscalingLimits.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits(); + if (object.minNodes != null) + message.minNodes = object.minNodes | 0; + if (object.minProcessingUnits != null) + message.minProcessingUnits = object.minProcessingUnits | 0; + if (object.maxNodes != null) + message.maxNodes = object.maxNodes | 0; + if (object.maxProcessingUnits != null) + message.maxProcessingUnits = object.maxProcessingUnits | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits} message AutoscalingLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + object.minNodes = message.minNodes; + if (options.oneofs) + object.minLimit = "minNodes"; + } + if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + object.minProcessingUnits = message.minProcessingUnits; + if (options.oneofs) + object.minLimit = "minProcessingUnits"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + object.maxNodes = message.maxNodes; + if (options.oneofs) + object.maxLimit = "maxNodes"; + } + if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + object.maxProcessingUnits = message.maxProcessingUnits; + if (options.oneofs) + object.maxLimit = "maxProcessingUnits"; + } + return object; + }; + + /** + * Converts this AutoscalingLimits to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @instance + * @returns {Object.} JSON object + */ + AutoscalingLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingLimits + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits"; + }; + + return AutoscalingLimits; + })(); + + AutoscalingConfig.AutoscalingTargets = (function() { + + /** + * Properties of an AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @interface IAutoscalingTargets + * @property {number|null} [highPriorityCpuUtilizationPercent] AutoscalingTargets highPriorityCpuUtilizationPercent + * @property {number|null} [storageUtilizationPercent] AutoscalingTargets storageUtilizationPercent + */ + + /** + * Constructs a new AutoscalingTargets. + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig + * @classdesc Represents an AutoscalingTargets. + * @implements IAutoscalingTargets + * @constructor + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + */ + function AutoscalingTargets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingTargets highPriorityCpuUtilizationPercent. + * @member {number} highPriorityCpuUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.highPriorityCpuUtilizationPercent = 0; + + /** + * AutoscalingTargets storageUtilizationPercent. + * @member {number} storageUtilizationPercent + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + */ + AutoscalingTargets.prototype.storageUtilizationPercent = 0; + + /** + * Creates a new AutoscalingTargets instance using the specified properties. + * @function create + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets=} [properties] Properties to set + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets instance + */ + AutoscalingTargets.create = function create(properties) { + return new AutoscalingTargets(properties); + }; + + /** + * Encodes the specified AutoscalingTargets message. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); + if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.storageUtilizationPercent); + return writer; + }; + + /** + * Encodes the specified AutoscalingTargets message, length delimited. Does not implicitly {@link google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.IAutoscalingTargets} message AutoscalingTargets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.highPriorityCpuUtilizationPercent = reader.int32(); + break; + } + case 2: { + message.storageUtilizationPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingTargets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingTargets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingTargets message. + * @function verify + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingTargets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) + return "highPriorityCpuUtilizationPercent: integer expected"; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + if (!$util.isInteger(message.storageUtilizationPercent)) + return "storageUtilizationPercent: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingTargets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} AutoscalingTargets + */ + AutoscalingTargets.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) + return object; + var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets(); + if (object.highPriorityCpuUtilizationPercent != null) + message.highPriorityCpuUtilizationPercent = object.highPriorityCpuUtilizationPercent | 0; + if (object.storageUtilizationPercent != null) + message.storageUtilizationPercent = object.storageUtilizationPercent | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingTargets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets} message AutoscalingTargets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingTargets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.highPriorityCpuUtilizationPercent = 0; + object.storageUtilizationPercent = 0; + } + if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; + if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + object.storageUtilizationPercent = message.storageUtilizationPercent; + return object; + }; + + /** + * Converts this AutoscalingTargets to JSON. + * @function toJSON + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @instance + * @returns {Object.} JSON object + */ + AutoscalingTargets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingTargets + * @function getTypeUrl + * @memberof google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingTargets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets"; + }; + + return AutoscalingTargets; + })(); + + return AutoscalingConfig; + })(); + v1.Instance = (function() { /** @@ -29283,6 +31633,7 @@ * @property {string|null} [displayName] Instance displayName * @property {number|null} [nodeCount] Instance nodeCount * @property {number|null} [processingUnits] Instance processingUnits + * @property {google.spanner.admin.instance.v1.IAutoscalingConfig|null} [autoscalingConfig] Instance autoscalingConfig * @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state * @property {Object.|null} [labels] Instance labels * @property {Array.|null} [endpointUris] Instance endpointUris @@ -29347,6 +31698,14 @@ */ Instance.prototype.processingUnits = 0; + /** + * Instance autoscalingConfig. + * @member {google.spanner.admin.instance.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.spanner.admin.instance.v1.Instance + * @instance + */ + Instance.prototype.autoscalingConfig = null; + /** * Instance state. * @member {google.spanner.admin.instance.v1.Instance.State} state @@ -29433,6 +31792,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -29487,6 +31848,10 @@ message.processingUnits = reader.int32(); break; } + case 17: { + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } case 6: { message.state = reader.int32(); break; @@ -29578,6 +31943,11 @@ if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) if (!$util.isInteger(message.processingUnits)) return "processingUnits: integer expected"; + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + error; + } if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -29637,6 +32007,11 @@ message.nodeCount = object.nodeCount | 0; if (object.processingUnits != null) message.processingUnits = object.processingUnits | 0; + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } switch (object.state) { default: if (typeof object.state === "number") { @@ -29710,6 +32085,7 @@ object.processingUnits = 0; object.createTime = null; object.updateTime = null; + object.autoscalingConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -29738,6 +32114,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); return object; }; @@ -40566,6 +42944,7 @@ case 0: case 2: case 3: + case 4: break; } return null; @@ -40668,6 +43047,10 @@ case 3: message.typeAnnotation = 3; break; + case "PG_OID": + case 4: + message.typeAnnotation = 4; + break; } return message; }; @@ -41228,12 +43611,14 @@ * @property {number} TYPE_ANNOTATION_CODE_UNSPECIFIED=0 TYPE_ANNOTATION_CODE_UNSPECIFIED value * @property {number} PG_NUMERIC=2 PG_NUMERIC value * @property {number} PG_JSONB=3 PG_JSONB value + * @property {number} PG_OID=4 PG_OID value */ v1.TypeAnnotationCode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TYPE_ANNOTATION_CODE_UNSPECIFIED"] = 0; values[valuesById[2] = "PG_NUMERIC"] = 2; values[valuesById[3] = "PG_JSONB"] = 3; + values[valuesById[4] = "PG_OID"] = 4; return values; })(); @@ -41764,6 +44149,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.spanner.v1.Spanner|batchWrite}. + * @memberof google.spanner.v1.Spanner + * @typedef BatchWriteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.spanner.v1.BatchWriteResponse} [response] BatchWriteResponse + */ + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @param {google.spanner.v1.Spanner.BatchWriteCallback} callback Node-style callback called with the error, if any, and BatchWriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { + return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); + }, "name", { value: "BatchWrite" }); + + /** + * Calls BatchWrite. + * @function batchWrite + * @memberof google.spanner.v1.Spanner + * @instance + * @param {google.spanner.v1.IBatchWriteRequest} request BatchWriteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Spanner; })(); @@ -44044,36 +46462,25 @@ return RequestOptions; })(); - v1.ExecuteSqlRequest = (function() { + v1.DirectedReadOptions = (function() { /** - * Properties of an ExecuteSqlRequest. + * Properties of a DirectedReadOptions. * @memberof google.spanner.v1 - * @interface IExecuteSqlRequest - * @property {string|null} [session] ExecuteSqlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction - * @property {string|null} [sql] ExecuteSqlRequest sql - * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params - * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes - * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken - * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode - * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken - * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno - * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions - * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled + * @interface IDirectedReadOptions + * @property {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null} [includeReplicas] DirectedReadOptions includeReplicas + * @property {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null} [excludeReplicas] DirectedReadOptions excludeReplicas */ /** - * Constructs a new ExecuteSqlRequest. + * Constructs a new DirectedReadOptions. * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest + * @classdesc Represents a DirectedReadOptions. + * @implements IDirectedReadOptions * @constructor - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set */ - function ExecuteSqlRequest(properties) { - this.paramTypes = {}; + function DirectedReadOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44081,251 +46488,103 @@ } /** - * ExecuteSqlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.session = ""; - - /** - * ExecuteSqlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.transaction = null; - - /** - * ExecuteSqlRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sql = ""; - - /** - * ExecuteSqlRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.params = null; - - /** - * ExecuteSqlRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; - - /** - * ExecuteSqlRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest queryMode. - * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.queryMode = 0; - - /** - * ExecuteSqlRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); - - /** - * ExecuteSqlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteSqlRequest + * DirectedReadOptions includeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IIncludeReplicas|null|undefined} includeReplicas + * @memberof google.spanner.v1.DirectedReadOptions * @instance */ - ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DirectedReadOptions.prototype.includeReplicas = null; /** - * ExecuteSqlRequest queryOptions. - * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions - * @memberof google.spanner.v1.ExecuteSqlRequest + * DirectedReadOptions excludeReplicas. + * @member {google.spanner.v1.DirectedReadOptions.IExcludeReplicas|null|undefined} excludeReplicas + * @memberof google.spanner.v1.DirectedReadOptions * @instance */ - ExecuteSqlRequest.prototype.queryOptions = null; + DirectedReadOptions.prototype.excludeReplicas = null; - /** - * ExecuteSqlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.requestOptions = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ExecuteSqlRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ExecuteSqlRequest + * DirectedReadOptions replicas. + * @member {"includeReplicas"|"excludeReplicas"|undefined} replicas + * @memberof google.spanner.v1.DirectedReadOptions * @instance */ - ExecuteSqlRequest.prototype.dataBoostEnabled = false; + Object.defineProperty(DirectedReadOptions.prototype, "replicas", { + get: $util.oneOfGetter($oneOfFields = ["includeReplicas", "excludeReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ExecuteSqlRequest instance using the specified properties. + * Creates a new DirectedReadOptions instance using the specified properties. * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static - * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance + * @param {google.spanner.v1.IDirectedReadOptions=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions instance */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); + DirectedReadOptions.create = function create(properties) { + return new DirectedReadOptions(properties); }; /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * Encodes the specified DirectedReadOptions message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteSqlRequest.encode = function encode(message, writer) { + DirectedReadOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); - if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); - if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) - $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); + if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) + $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * Encodes the specified DirectedReadOptions message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static - * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {google.spanner.v1.IDirectedReadOptions} message DirectedReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * Decodes a DirectedReadOptions message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteSqlRequest.decode = function decode(reader, length) { + DirectedReadOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.session = reader.string(); + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.decode(reader, reader.uint32()); break; } case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - 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.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.resumeToken = reader.bytes(); - break; - } - case 7: { - message.queryMode = reader.int32(); - break; - } - case 8: { - message.partitionToken = reader.bytes(); - break; - } - case 9: { - message.seqno = reader.int64(); - break; - } - case 10: { - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); - break; - } - case 11: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; - } - case 16: { - message.dataBoostEnabled = reader.bool(); + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.decode(reader, reader.uint32()); break; } default: @@ -44337,321 +46596,150 @@ }; /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * Decodes a DirectedReadOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + DirectedReadOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteSqlRequest message. + * Verifies a DirectedReadOptions message. * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteSqlRequest.verify = function verify(message) { + DirectedReadOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + var properties = {}; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas); if (error) - return "paramTypes." + error; + return "includeReplicas." + error; } } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - switch (message.queryMode) { - default: - return "queryMode: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + if (properties.replicas === 1) + return "replicas: multiple values"; + properties.replicas = 1; + { + var error = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify(message.excludeReplicas); + if (error) + return "excludeReplicas." + error; } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { - var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); - if (error) - return "queryOptions." + error; } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; return null; }; /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DirectedReadOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @returns {google.spanner.v1.DirectedReadOptions} DirectedReadOptions */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) + DirectedReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions) return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + var message = new $root.google.spanner.v1.DirectedReadOptions(); + if (object.includeReplicas != null) { + if (typeof object.includeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); + message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas); } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); - } - } - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - switch (object.queryMode) { - default: - if (typeof object.queryMode === "number") { - message.queryMode = object.queryMode; - break; - } - break; - case "NORMAL": - case 0: - message.queryMode = 0; - break; - case "PLAN": - case 1: - message.queryMode = 1; - break; - case "PROFILE": - case 2: - message.queryMode = 2; - break; - } - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.queryOptions != null) { - if (typeof object.queryOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); - message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); + if (object.excludeReplicas != null) { + if (typeof object.excludeReplicas !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); + message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas); } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); return message; }; /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * Creates a plain object from a DirectedReadOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static - * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {google.spanner.v1.DirectedReadOptions} message DirectedReadOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteSqlRequest.toObject = function toObject(message, options) { + DirectedReadOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.sql = ""; - object.params = null; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - object.queryMode = options.enums === String ? "NORMAL" : 0; - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.queryOptions = null; - object.requestOptions = null; - object.dataBoostEnabled = false; + if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); + if (options.oneofs) + object.replicas = "includeReplicas"; } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); + if (options.oneofs) + object.replicas = "excludeReplicas"; } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) - object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) - object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; return object; }; /** - * Converts this ExecuteSqlRequest to JSON. + * Converts this DirectedReadOptions to JSON. * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @instance * @returns {Object.} JSON object */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { + DirectedReadOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteSqlRequest + * Gets the default type url for DirectedReadOptions * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest + * @memberof google.spanner.v1.DirectedReadOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DirectedReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions"; }; - /** - * QueryMode enum. - * @name google.spanner.v1.ExecuteSqlRequest.QueryMode - * @enum {number} - * @property {number} NORMAL=0 NORMAL value - * @property {number} PLAN=1 PLAN value - * @property {number} PROFILE=2 PROFILE value - */ - ExecuteSqlRequest.QueryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NORMAL"] = 0; - values[valuesById[1] = "PLAN"] = 1; - values[valuesById[2] = "PROFILE"] = 2; - return values; - })(); - - ExecuteSqlRequest.QueryOptions = (function() { + DirectedReadOptions.ReplicaSelection = (function() { /** - * Properties of a QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @interface IQueryOptions - * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion - * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage + * Properties of a ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IReplicaSelection + * @property {string|null} [location] ReplicaSelection location + * @property {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type|null} [type] ReplicaSelection type */ /** - * Constructs a new QueryOptions. - * @memberof google.spanner.v1.ExecuteSqlRequest - * @classdesc Represents a QueryOptions. - * @implements IQueryOptions + * Constructs a new ReplicaSelection. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents a ReplicaSelection. + * @implements IReplicaSelection * @constructor - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set */ - function QueryOptions(properties) { + function ReplicaSelection(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44659,89 +46747,89 @@ } /** - * QueryOptions optimizerVersion. - * @member {string} optimizerVersion - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * ReplicaSelection location. + * @member {string} location + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @instance */ - QueryOptions.prototype.optimizerVersion = ""; + ReplicaSelection.prototype.location = ""; /** - * QueryOptions optimizerStatisticsPackage. - * @member {string} optimizerStatisticsPackage - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * ReplicaSelection type. + * @member {google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type} type + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @instance */ - QueryOptions.prototype.optimizerStatisticsPackage = ""; + ReplicaSelection.prototype.type = 0; /** - * Creates a new QueryOptions instance using the specified properties. + * Creates a new ReplicaSelection instance using the specified properties. * @function create - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection instance */ - QueryOptions.create = function create(properties) { - return new QueryOptions(properties); + ReplicaSelection.create = function create(properties) { + return new ReplicaSelection(properties); }; /** - * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * Encodes the specified ReplicaSelection message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryOptions.encode = function encode(message, writer) { + ReplicaSelection.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); - if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); return writer; }; /** - * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * Encodes the specified ReplicaSelection message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static - * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {google.spanner.v1.DirectedReadOptions.IReplicaSelection} message ReplicaSelection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryOptions message from the specified reader or buffer. + * Decodes a ReplicaSelection message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryOptions.decode = function decode(reader, length) { + ReplicaSelection.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.optimizerVersion = reader.string(); + message.location = reader.string(); break; } case 2: { - message.optimizerStatisticsPackage = reader.string(); + message.type = reader.int32(); break; } default: @@ -44753,476 +46841,420 @@ }; /** - * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * Decodes a ReplicaSelection message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryOptions.decodeDelimited = function decodeDelimited(reader) { + ReplicaSelection.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryOptions message. + * Verifies a ReplicaSelection message. * @function verify - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryOptions.verify = function verify(message) { + ReplicaSelection.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - if (!$util.isString(message.optimizerVersion)) - return "optimizerVersion: string expected"; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - if (!$util.isString(message.optimizerStatisticsPackage)) - return "optimizerStatisticsPackage: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ReplicaSelection message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @returns {google.spanner.v1.DirectedReadOptions.ReplicaSelection} ReplicaSelection */ - QueryOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) + ReplicaSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) return object; - var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); - if (object.optimizerVersion != null) - message.optimizerVersion = String(object.optimizerVersion); - if (object.optimizerStatisticsPackage != null) - message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); + var message = new $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection(); + if (object.location != null) + message.location = String(object.location); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "READ_WRITE": + case 1: + message.type = 1; + break; + case "READ_ONLY": + case 2: + message.type = 2; + break; + } return message; }; /** - * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * Creates a plain object from a ReplicaSelection message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static - * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions + * @param {google.spanner.v1.DirectedReadOptions.ReplicaSelection} message ReplicaSelection * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryOptions.toObject = function toObject(message, options) { + ReplicaSelection.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.optimizerVersion = ""; - object.optimizerStatisticsPackage = ""; + object.location = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; } - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) - object.optimizerVersion = message.optimizerVersion; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) - object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; return object; }; /** - * Converts this QueryOptions to JSON. + * Converts this ReplicaSelection to JSON. * @function toJSON - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @instance * @returns {Object.} JSON object */ - QueryOptions.prototype.toJSON = function toJSON() { + ReplicaSelection.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryOptions + * Gets the default type url for ReplicaSelection * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @memberof google.spanner.v1.DirectedReadOptions.ReplicaSelection * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReplicaSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ReplicaSelection"; }; - return QueryOptions; - })(); - - return ExecuteSqlRequest; - })(); - - v1.ExecuteBatchDmlRequest = (function() { - - /** - * Properties of an ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlRequest - * @property {string|null} [session] ExecuteBatchDmlRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction - * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements - * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions - */ + /** + * Type enum. + * @name google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + */ + ReplicaSelection.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + return values; + })(); - /** - * Constructs a new ExecuteBatchDmlRequest. - * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlRequest. - * @implements IExecuteBatchDmlRequest - * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - */ - function ExecuteBatchDmlRequest(properties) { - this.statements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return ReplicaSelection; + })(); - /** - * ExecuteBatchDmlRequest session. - * @member {string} session - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.session = ""; + DirectedReadOptions.IncludeReplicas = (function() { - /** - * ExecuteBatchDmlRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.transaction = null; + /** + * Properties of an IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IIncludeReplicas + * @property {Array.|null} [replicaSelections] IncludeReplicas replicaSelections + * @property {boolean|null} [autoFailoverDisabled] IncludeReplicas autoFailoverDisabled + */ - /** - * ExecuteBatchDmlRequest statements. - * @member {Array.} statements - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; + /** + * Constructs a new IncludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an IncludeReplicas. + * @implements IIncludeReplicas + * @constructor + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + */ + function IncludeReplicas(properties) { + this.replicaSelections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ExecuteBatchDmlRequest seqno. - * @member {number|Long} seqno - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * IncludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.replicaSelections = $util.emptyArray; - /** - * ExecuteBatchDmlRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - */ - ExecuteBatchDmlRequest.prototype.requestOptions = null; + /** + * IncludeReplicas autoFailoverDisabled. + * @member {boolean} autoFailoverDisabled + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + */ + IncludeReplicas.prototype.autoFailoverDisabled = false; - /** - * Creates a new ExecuteBatchDmlRequest instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance - */ - ExecuteBatchDmlRequest.create = function create(properties) { - return new ExecuteBatchDmlRequest(properties); - }; + /** + * Creates a new IncludeReplicas instance using the specified properties. + * @function create + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas instance + */ + IncludeReplicas.create = function create(properties) { + return new IncludeReplicas(properties); + }; - /** - * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.statements != null && message.statements.length) - for (var i = 0; i < message.statements.length; ++i) - $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified IncludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); + return writer; + }; - /** - * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified IncludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IIncludeReplicas} message IncludeReplicas message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.statements && message.statements.length)) - message.statements = []; - message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); - break; - } - case 4: { - message.seqno = reader.int64(); + /** + * Decodes an IncludeReplicas message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.autoFailoverDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 5: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); - break; + } + return message; + }; + + /** + * Decodes an IncludeReplicas message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncludeReplicas.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncludeReplicas message. + * @function verify + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncludeReplicas.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); + if (error) + return "replicaSelections." + error; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + if (typeof message.autoFailoverDisabled !== "boolean") + return "autoFailoverDisabled: boolean expected"; + return null; + }; - /** - * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteBatchDmlRequest message. - * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteBatchDmlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.statements != null && message.hasOwnProperty("statements")) { - if (!Array.isArray(message.statements)) - return "statements: array expected"; - for (var i = 0; i < message.statements.length; ++i) { - var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); - if (error) - return "statements." + error; - } - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) - return "seqno: integer|Long expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } - return null; - }; + /** + * Creates an IncludeReplicas message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.DirectedReadOptions.IncludeReplicas} IncludeReplicas + */ + IncludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) + return object; + var message = new $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); + } + } + if (object.autoFailoverDisabled != null) + message.autoFailoverDisabled = Boolean(object.autoFailoverDisabled); + return message; + }; - /** - * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest - */ - ExecuteBatchDmlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) + /** + * Creates a plain object from an IncludeReplicas message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {google.spanner.v1.DirectedReadOptions.IncludeReplicas} message IncludeReplicas + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncludeReplicas.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (options.defaults) + object.autoFailoverDisabled = false; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + } + if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + object.autoFailoverDisabled = message.autoFailoverDisabled; return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.statements) { - if (!Array.isArray(object.statements)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); - message.statements = []; - for (var i = 0; i < object.statements.length; ++i) { - if (typeof object.statements[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); - message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); - } - } - if (object.seqno != null) - if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; - else if (typeof object.seqno === "string") - message.seqno = parseInt(object.seqno, 10); - else if (typeof object.seqno === "number") - message.seqno = object.seqno; - else if (typeof object.seqno === "object") - message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } - return message; - }; + }; - /** - * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteBatchDmlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statements = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seqno = options.longs === String ? "0" : 0; - object.requestOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.statements && message.statements.length) { - object.statements = []; - for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); - } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") - object.seqno = options.longs === String ? String(message.seqno) : message.seqno; - else - object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - return object; - }; + /** + * Converts this IncludeReplicas to JSON. + * @function toJSON + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @instance + * @returns {Object.} JSON object + */ + IncludeReplicas.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ExecuteBatchDmlRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for IncludeReplicas + * @function getTypeUrl + * @memberof google.spanner.v1.DirectedReadOptions.IncludeReplicas + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.IncludeReplicas"; + }; - /** - * Gets the default type url for ExecuteBatchDmlRequest - * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; - }; + return IncludeReplicas; + })(); - ExecuteBatchDmlRequest.Statement = (function() { + DirectedReadOptions.ExcludeReplicas = (function() { /** - * Properties of a Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @interface IStatement - * @property {string|null} [sql] Statement sql - * @property {google.protobuf.IStruct|null} [params] Statement params - * @property {Object.|null} [paramTypes] Statement paramTypes + * Properties of an ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @interface IExcludeReplicas + * @property {Array.|null} [replicaSelections] ExcludeReplicas replicaSelections */ /** - * Constructs a new Statement. - * @memberof google.spanner.v1.ExecuteBatchDmlRequest - * @classdesc Represents a Statement. - * @implements IStatement + * Constructs a new ExcludeReplicas. + * @memberof google.spanner.v1.DirectedReadOptions + * @classdesc Represents an ExcludeReplicas. + * @implements IExcludeReplicas * @constructor - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set */ - function Statement(properties) { - this.paramTypes = {}; + function ExcludeReplicas(properties) { + this.replicaSelections = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45230,125 +47262,78 @@ } /** - * Statement sql. - * @member {string} sql - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.sql = ""; - - /** - * Statement params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement - * @instance - */ - Statement.prototype.params = null; - - /** - * Statement paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * ExcludeReplicas replicaSelections. + * @member {Array.} replicaSelections + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @instance */ - Statement.prototype.paramTypes = $util.emptyObject; + ExcludeReplicas.prototype.replicaSelections = $util.emptyArray; /** - * Creates a new Statement instance using the specified properties. + * Creates a new ExcludeReplicas instance using the specified properties. * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas=} [properties] Properties to set + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas instance */ - Statement.create = function create(properties) { - return new Statement(properties); + ExcludeReplicas.create = function create(properties) { + return new ExcludeReplicas(properties); }; /** - * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * Encodes the specified ExcludeReplicas message. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Statement.encode = function encode(message, writer) { + ExcludeReplicas.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), 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.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.replicaSelections != null && message.replicaSelections.length) + for (var i = 0; i < message.replicaSelections.length; ++i) + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * Encodes the specified ExcludeReplicas message, length delimited. Does not implicitly {@link google.spanner.v1.DirectedReadOptions.ExcludeReplicas.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {google.spanner.v1.DirectedReadOptions.IExcludeReplicas} message ExcludeReplicas message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Statement.encodeDelimited = function encodeDelimited(message, writer) { + ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Statement message from the specified reader or buffer. + * Decodes an ExcludeReplicas message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Statement.decode = function decode(reader, length) { + ExcludeReplicas.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.sql = reader.string(); - break; - } - case 2: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - 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.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; + if (!(message.replicaSelections && message.replicaSelections.length)) + message.replicaSelections = []; + message.replicaSelections.push($root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.decode(reader, reader.uint32())); break; } default: @@ -45360,169 +47345,155 @@ }; /** - * Decodes a Statement message from the specified reader or buffer, length delimited. + * Decodes an ExcludeReplicas message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Statement.decodeDelimited = function decodeDelimited(reader) { + ExcludeReplicas.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Statement message. + * Verifies an ExcludeReplicas message. * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Statement.verify = function verify(message) { + ExcludeReplicas.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (!Array.isArray(message.replicaSelections)) + return "replicaSelections: array expected"; + for (var i = 0; i < message.replicaSelections.length; ++i) { + var error = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.verify(message.replicaSelections[i]); if (error) - return "paramTypes." + error; + return "replicaSelections." + error; } } return null; }; /** - * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * Creates an ExcludeReplicas message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @returns {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} ExcludeReplicas */ - Statement.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) + ExcludeReplicas.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + var message = new $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas(); + if (object.replicaSelections) { + if (!Array.isArray(object.replicaSelections)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); + message.replicaSelections = []; + for (var i = 0; i < object.replicaSelections.length; ++i) { + if (typeof object.replicaSelections[i] !== "object") + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); + message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i]); } } return message; }; /** - * Creates a plain object from a Statement message. Also converts values to other types if specified. + * Creates a plain object from an ExcludeReplicas message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static - * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement + * @param {google.spanner.v1.DirectedReadOptions.ExcludeReplicas} message ExcludeReplicas * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Statement.toObject = function toObject(message, options) { + ExcludeReplicas.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.sql = ""; - object.params = null; - } - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + if (options.arrays || options.defaults) + object.replicaSelections = []; + if (message.replicaSelections && message.replicaSelections.length) { + object.replicaSelections = []; + for (var j = 0; j < message.replicaSelections.length; ++j) + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); } return object; }; /** - * Converts this Statement to JSON. + * Converts this ExcludeReplicas to JSON. * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @instance * @returns {Object.} JSON object */ - Statement.prototype.toJSON = function toJSON() { + ExcludeReplicas.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Statement + * Gets the default type url for ExcludeReplicas * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @memberof google.spanner.v1.DirectedReadOptions.ExcludeReplicas * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExcludeReplicas.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; + return typeUrlPrefix + "/google.spanner.v1.DirectedReadOptions.ExcludeReplicas"; }; - return Statement; + return ExcludeReplicas; })(); - return ExecuteBatchDmlRequest; + return DirectedReadOptions; })(); - v1.ExecuteBatchDmlResponse = (function() { + v1.ExecuteSqlRequest = (function() { /** - * Properties of an ExecuteBatchDmlResponse. + * Properties of an ExecuteSqlRequest. * @memberof google.spanner.v1 - * @interface IExecuteBatchDmlResponse - * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets - * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status + * @interface IExecuteSqlRequest + * @property {string|null} [session] ExecuteSqlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteSqlRequest transaction + * @property {string|null} [sql] ExecuteSqlRequest sql + * @property {google.protobuf.IStruct|null} [params] ExecuteSqlRequest params + * @property {Object.|null} [paramTypes] ExecuteSqlRequest paramTypes + * @property {Uint8Array|null} [resumeToken] ExecuteSqlRequest resumeToken + * @property {google.spanner.v1.ExecuteSqlRequest.QueryMode|null} [queryMode] ExecuteSqlRequest queryMode + * @property {Uint8Array|null} [partitionToken] ExecuteSqlRequest partitionToken + * @property {number|Long|null} [seqno] ExecuteSqlRequest seqno + * @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null} [queryOptions] ExecuteSqlRequest queryOptions + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled */ /** - * Constructs a new ExecuteBatchDmlResponse. + * Constructs a new ExecuteSqlRequest. * @memberof google.spanner.v1 - * @classdesc Represents an ExecuteBatchDmlResponse. - * @implements IExecuteBatchDmlResponse + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest * @constructor - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set */ - function ExecuteBatchDmlResponse(properties) { - this.resultSets = []; + function ExecuteSqlRequest(properties) { + this.paramTypes = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45530,111 +47501,1587 @@ } /** - * ExecuteBatchDmlResponse resultSets. - * @member {Array.} resultSets - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * ExecuteSqlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteSqlRequest * @instance */ - ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; + ExecuteSqlRequest.prototype.session = ""; /** - * ExecuteBatchDmlResponse status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * ExecuteSqlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteSqlRequest * @instance */ - ExecuteBatchDmlResponse.prototype.status = null; + ExecuteSqlRequest.prototype.transaction = null; /** - * Creates a new ExecuteBatchDmlResponse instance using the specified properties. - * @function create - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance + * ExecuteSqlRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance */ - ExecuteBatchDmlResponse.create = function create(properties) { - return new ExecuteBatchDmlResponse(properties); - }; + ExecuteSqlRequest.prototype.sql = ""; /** - * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExecuteSqlRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance */ - ExecuteBatchDmlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resultSets != null && message.resultSets.length) - for (var i = 0; i < message.resultSets.length; ++i) - $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + ExecuteSqlRequest.prototype.params = null; /** - * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExecuteSqlRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance */ - ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ExecuteSqlRequest.prototype.paramTypes = $util.emptyObject; /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ExecuteSqlRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance */ - ExecuteBatchDmlResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.resultSets && message.resultSets.length)) - message.resultSets = []; - message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + ExecuteSqlRequest.prototype.resumeToken = $util.newBuffer([]); /** - * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.ExecuteBatchDmlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ExecuteSqlRequest queryMode. + * @member {google.spanner.v1.ExecuteSqlRequest.QueryMode} queryMode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryMode = 0; + + /** + * ExecuteSqlRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ExecuteSqlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteSqlRequest queryOptions. + * @member {google.spanner.v1.ExecuteSqlRequest.IQueryOptions|null|undefined} queryOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.queryOptions = null; + + /** + * ExecuteSqlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.requestOptions = null; + + /** + * ExecuteSqlRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.directedReadOptions = null; + + /** + * ExecuteSqlRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.dataBoostEnabled = false; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); + if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryMode); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.partitionToken); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); + if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) + $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + 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.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.resumeToken = reader.bytes(); + break; + } + case 7: { + message.queryMode = reader.int32(); + break; + } + case 8: { + message.partitionToken = reader.bytes(); + break; + } + case 9: { + message.seqno = reader.int64(); + break; + } + case 10: { + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 16: { + message.dataBoostEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + switch (message.queryMode) { + default: + return "queryMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { + var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions); + if (error) + return "queryOptions." + error; + } + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; + switch (object.queryMode) { + default: + if (typeof object.queryMode === "number") { + message.queryMode = object.queryMode; + break; + } + break; + case "NORMAL": + case 0: + message.queryMode = 0; + break; + case "PLAN": + case 1: + message.queryMode = 1; + break; + case "PROFILE": + case 2: + message.queryMode = 2; + break; + } + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.queryOptions != null) { + if (typeof object.queryOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); + message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions); + } + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {google.spanner.v1.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } + object.queryMode = options.enums === String ? "NORMAL" : 0; + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.queryOptions = null; + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; + if (message.queryMode != null && message.hasOwnProperty("queryMode")) + object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) + object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest"; + }; + + /** + * QueryMode enum. + * @name google.spanner.v1.ExecuteSqlRequest.QueryMode + * @enum {number} + * @property {number} NORMAL=0 NORMAL value + * @property {number} PLAN=1 PLAN value + * @property {number} PROFILE=2 PROFILE value + */ + ExecuteSqlRequest.QueryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NORMAL"] = 0; + values[valuesById[1] = "PLAN"] = 1; + values[valuesById[2] = "PROFILE"] = 2; + return values; + })(); + + ExecuteSqlRequest.QueryOptions = (function() { + + /** + * Properties of a QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @interface IQueryOptions + * @property {string|null} [optimizerVersion] QueryOptions optimizerVersion + * @property {string|null} [optimizerStatisticsPackage] QueryOptions optimizerStatisticsPackage + */ + + /** + * Constructs a new QueryOptions. + * @memberof google.spanner.v1.ExecuteSqlRequest + * @classdesc Represents a QueryOptions. + * @implements IQueryOptions + * @constructor + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + */ + function QueryOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryOptions optimizerVersion. + * @member {string} optimizerVersion + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerVersion = ""; + + /** + * QueryOptions optimizerStatisticsPackage. + * @member {string} optimizerStatisticsPackage + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + */ + QueryOptions.prototype.optimizerStatisticsPackage = ""; + + /** + * Creates a new QueryOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions instance + */ + QueryOptions.create = function create(properties) { + return new QueryOptions(properties); + }; + + /** + * Encodes the specified QueryOptions message. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); + if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.optimizerStatisticsPackage); + return writer; + }; + + /** + * Encodes the specified QueryOptions message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} message QueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.optimizerVersion = reader.string(); + break; + } + case 2: { + message.optimizerStatisticsPackage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryOptions message. + * @function verify + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + if (!$util.isString(message.optimizerVersion)) + return "optimizerVersion: string expected"; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + if (!$util.isString(message.optimizerStatisticsPackage)) + return "optimizerStatisticsPackage: string expected"; + return null; + }; + + /** + * Creates a QueryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteSqlRequest.QueryOptions} QueryOptions + */ + QueryOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) + return object; + var message = new $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions(); + if (object.optimizerVersion != null) + message.optimizerVersion = String(object.optimizerVersion); + if (object.optimizerStatisticsPackage != null) + message.optimizerStatisticsPackage = String(object.optimizerStatisticsPackage); + return message; + }; + + /** + * Creates a plain object from a QueryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} message QueryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.optimizerVersion = ""; + object.optimizerStatisticsPackage = ""; + } + if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + object.optimizerVersion = message.optimizerVersion; + if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; + return object; + }; + + /** + * Converts this QueryOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @instance + * @returns {Object.} JSON object + */ + QueryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryOptions + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteSqlRequest.QueryOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteSqlRequest.QueryOptions"; + }; + + return QueryOptions; + })(); + + return ExecuteSqlRequest; + })(); + + v1.ExecuteBatchDmlRequest = (function() { + + /** + * Properties of an ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlRequest + * @property {string|null} [session] ExecuteBatchDmlRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ExecuteBatchDmlRequest transaction + * @property {Array.|null} [statements] ExecuteBatchDmlRequest statements + * @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions + */ + + /** + * Constructs a new ExecuteBatchDmlRequest. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlRequest. + * @implements IExecuteBatchDmlRequest + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + */ + function ExecuteBatchDmlRequest(properties) { + this.statements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlRequest session. + * @member {string} session + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.session = ""; + + /** + * ExecuteBatchDmlRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.transaction = null; + + /** + * ExecuteBatchDmlRequest statements. + * @member {Array.} statements + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.statements = $util.emptyArray; + + /** + * ExecuteBatchDmlRequest seqno. + * @member {number|Long} seqno + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.seqno = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteBatchDmlRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + */ + ExecuteBatchDmlRequest.prototype.requestOptions = null; + + /** + * Creates a new ExecuteBatchDmlRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest instance + */ + ExecuteBatchDmlRequest.create = function create(properties) { + return new ExecuteBatchDmlRequest(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.statements != null && message.statements.length) + for (var i = 0; i < message.statements.length; ++i) + $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.IExecuteBatchDmlRequest} message ExecuteBatchDmlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.statements && message.statements.length)) + message.statements = []; + message.statements.push($root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.decode(reader, reader.uint32())); + break; + } + case 4: { + message.seqno = reader.int64(); + break; + } + case 5: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteBatchDmlRequest message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.statements != null && message.hasOwnProperty("statements")) { + if (!Array.isArray(message.statements)) + return "statements: array expected"; + for (var i = 0; i < message.statements.length; ++i) { + var error = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify(message.statements[i]); + if (error) + return "statements." + error; + } + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) + return "seqno: integer|Long expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); + if (error) + return "requestOptions." + error; + } + return null; + }; + + /** + * Creates an ExecuteBatchDmlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest} ExecuteBatchDmlRequest + */ + ExecuteBatchDmlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.statements) { + if (!Array.isArray(object.statements)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); + message.statements = []; + for (var i = 0; i < object.statements.length; ++i) { + if (typeof object.statements[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); + message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i]); + } + } + if (object.seqno != null) + if ($util.Long) + (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + else if (typeof object.seqno === "string") + message.seqno = parseInt(object.seqno, 10); + else if (typeof object.seqno === "number") + message.seqno = object.seqno; + else if (typeof object.seqno === "object") + message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest} message ExecuteBatchDmlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statements = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seqno = options.longs === String ? "0" : 0; + object.requestOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.statements && message.statements.length) { + object.statements = []; + for (var j = 0; j < message.statements.length; ++j) + object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); + } + if (message.seqno != null && message.hasOwnProperty("seqno")) + if (typeof message.seqno === "number") + object.seqno = options.longs === String ? String(message.seqno) : message.seqno; + else + object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + return object; + }; + + /** + * Converts this ExecuteBatchDmlRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlRequest + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest"; + }; + + ExecuteBatchDmlRequest.Statement = (function() { + + /** + * Properties of a Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @interface IStatement + * @property {string|null} [sql] Statement sql + * @property {google.protobuf.IStruct|null} [params] Statement params + * @property {Object.|null} [paramTypes] Statement paramTypes + */ + + /** + * Constructs a new Statement. + * @memberof google.spanner.v1.ExecuteBatchDmlRequest + * @classdesc Represents a Statement. + * @implements IStatement + * @constructor + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + */ + function Statement(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Statement sql. + * @member {string} sql + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.sql = ""; + + /** + * Statement params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.params = null; + + /** + * Statement paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + */ + Statement.prototype.paramTypes = $util.emptyObject; + + /** + * Creates a new Statement instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement instance + */ + Statement.create = function create(properties) { + return new Statement(properties); + }; + + /** + * Encodes the specified Statement message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), 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.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Statement message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlRequest.Statement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.IStatement} message Statement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Statement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Statement message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sql = reader.string(); + break; + } + case 2: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + 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.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Statement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Statement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Statement message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Statement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (error) + return "paramTypes." + error; + } + } + return null; + }; + + /** + * Creates a Statement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlRequest.Statement} Statement + */ + Statement.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement(); + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Statement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {google.spanner.v1.ExecuteBatchDmlRequest.Statement} message Statement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Statement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.sql = ""; + object.params = null; + } + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Statement to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @instance + * @returns {Object.} JSON object + */ + Statement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Statement + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlRequest.Statement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Statement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlRequest.Statement"; + }; + + return Statement; + })(); + + return ExecuteBatchDmlRequest; + })(); + + v1.ExecuteBatchDmlResponse = (function() { + + /** + * Properties of an ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @interface IExecuteBatchDmlResponse + * @property {Array.|null} [resultSets] ExecuteBatchDmlResponse resultSets + * @property {google.rpc.IStatus|null} [status] ExecuteBatchDmlResponse status + */ + + /** + * Constructs a new ExecuteBatchDmlResponse. + * @memberof google.spanner.v1 + * @classdesc Represents an ExecuteBatchDmlResponse. + * @implements IExecuteBatchDmlResponse + * @constructor + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + */ + function ExecuteBatchDmlResponse(properties) { + this.resultSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteBatchDmlResponse resultSets. + * @member {Array.} resultSets + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.resultSets = $util.emptyArray; + + /** + * ExecuteBatchDmlResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + */ + ExecuteBatchDmlResponse.prototype.status = null; + + /** + * Creates a new ExecuteBatchDmlResponse instance using the specified properties. + * @function create + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse=} [properties] Properties to set + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse instance + */ + ExecuteBatchDmlResponse.create = function create(properties) { + return new ExecuteBatchDmlResponse(properties); + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resultSets != null && message.resultSets.length) + for (var i = 0; i < message.resultSets.length; ++i) + $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteBatchDmlResponse message, length delimited. Does not implicitly {@link google.spanner.v1.ExecuteBatchDmlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.IExecuteBatchDmlResponse} message ExecuteBatchDmlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteBatchDmlResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resultSets && message.resultSets.length)) + message.resultSets = []; + message.resultSets.push($root.google.spanner.v1.ResultSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteBatchDmlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExecuteBatchDmlResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) @@ -45643,138 +49090,1143 @@ }; /** - * Verifies an ExecuteBatchDmlResponse message. + * Verifies an ExecuteBatchDmlResponse message. + * @function verify + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteBatchDmlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resultSets != null && message.hasOwnProperty("resultSets")) { + if (!Array.isArray(message.resultSets)) + return "resultSets: array expected"; + for (var i = 0; i < message.resultSets.length; ++i) { + var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); + if (error) + return "resultSets." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + */ + ExecuteBatchDmlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) + return object; + var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); + if (object.resultSets) { + if (!Array.isArray(object.resultSets)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); + message.resultSets = []; + for (var i = 0; i < object.resultSets.length; ++i) { + if (typeof object.resultSets[i] !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); + message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteBatchDmlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resultSets = []; + if (options.defaults) + object.status = null; + if (message.resultSets && message.resultSets.length) { + object.resultSets = []; + for (var j = 0; j < message.resultSets.length; ++j) + object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this ExecuteBatchDmlResponse to JSON. + * @function toJSON + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteBatchDmlResponse + * @function getTypeUrl + * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; + }; + + return ExecuteBatchDmlResponse; + })(); + + v1.PartitionOptions = (function() { + + /** + * Properties of a PartitionOptions. + * @memberof google.spanner.v1 + * @interface IPartitionOptions + * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes + * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions + */ + + /** + * Constructs a new PartitionOptions. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionOptions. + * @implements IPartitionOptions + * @constructor + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + */ + function PartitionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionOptions partitionSizeBytes. + * @member {number|Long} partitionSizeBytes + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PartitionOptions maxPartitions. + * @member {number|Long} maxPartitions + * @memberof google.spanner.v1.PartitionOptions + * @instance + */ + PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PartitionOptions instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance + */ + PartitionOptions.create = function create(properties) { + return new PartitionOptions(properties); + }; + + /** + * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); + if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); + return writer; + }; + + /** + * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.partitionSizeBytes = reader.int64(); + break; + } + case 2: { + message.maxPartitions = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionOptions message. + * @function verify + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) + return "partitionSizeBytes: integer|Long expected"; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) + return "maxPartitions: integer|Long expected"; + return null; + }; + + /** + * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + */ + PartitionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionOptions) + return object; + var message = new $root.google.spanner.v1.PartitionOptions(); + if (object.partitionSizeBytes != null) + if ($util.Long) + (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; + else if (typeof object.partitionSizeBytes === "string") + message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); + else if (typeof object.partitionSizeBytes === "number") + message.partitionSizeBytes = object.partitionSizeBytes; + else if (typeof object.partitionSizeBytes === "object") + message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); + if (object.maxPartitions != null) + if ($util.Long) + (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; + else if (typeof object.maxPartitions === "string") + message.maxPartitions = parseInt(object.maxPartitions, 10); + else if (typeof object.maxPartitions === "number") + message.maxPartitions = object.maxPartitions; + else if (typeof object.maxPartitions === "object") + message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {google.spanner.v1.PartitionOptions} message PartitionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPartitions = options.longs === String ? "0" : 0; + } + if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (typeof message.partitionSizeBytes === "number") + object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; + else + object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; + if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (typeof message.maxPartitions === "number") + object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; + else + object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; + return object; + }; + + /** + * Converts this PartitionOptions to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionOptions + * @instance + * @returns {Object.} JSON object + */ + PartitionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionOptions + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; + }; + + return PartitionOptions; + })(); + + v1.PartitionQueryRequest = (function() { + + /** + * Properties of a PartitionQueryRequest. + * @memberof google.spanner.v1 + * @interface IPartitionQueryRequest + * @property {string|null} [session] PartitionQueryRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction + * @property {string|null} [sql] PartitionQueryRequest sql + * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params + * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions + */ + + /** + * Constructs a new PartitionQueryRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionQueryRequest. + * @implements IPartitionQueryRequest + * @constructor + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + */ + function PartitionQueryRequest(properties) { + this.paramTypes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionQueryRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.session = ""; + + /** + * PartitionQueryRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.transaction = null; + + /** + * PartitionQueryRequest sql. + * @member {string} sql + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.sql = ""; + + /** + * PartitionQueryRequest params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.params = null; + + /** + * PartitionQueryRequest paramTypes. + * @member {Object.} paramTypes + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; + + /** + * PartitionQueryRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + */ + PartitionQueryRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance + */ + PartitionQueryRequest.create = function create(properties) { + return new PartitionQueryRequest(properties); + }; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) + for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sql = reader.string(); + break; + } + case 4: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.paramTypes === $util.emptyObject) + message.paramTypes = {}; + 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.spanner.v1.Type.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.paramTypes[key] = value; + break; + } + case 6: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionQueryRequest message. * @function verify - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @memberof google.spanner.v1.PartitionQueryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteBatchDmlResponse.verify = function verify(message) { + PartitionQueryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resultSets != null && message.hasOwnProperty("resultSets")) { - if (!Array.isArray(message.resultSets)) - return "resultSets: array expected"; - for (var i = 0; i < message.resultSets.length; ++i) { - var error = $root.google.spanner.v1.ResultSet.verify(message.resultSets[i]); + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (!$util.isObject(message.paramTypes)) + return "paramTypes: object expected"; + var key = Object.keys(message.paramTypes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); if (error) - return "resultSets." + error; + return "paramTypes." + error; } } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); if (error) - return "status." + error; + return "partitionOptions." + error; } return null; }; /** - * Creates an ExecuteBatchDmlResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @memberof google.spanner.v1.PartitionQueryRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.ExecuteBatchDmlResponse} ExecuteBatchDmlResponse + * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest */ - ExecuteBatchDmlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) + PartitionQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) return object; - var message = new $root.google.spanner.v1.ExecuteBatchDmlResponse(); - if (object.resultSets) { - if (!Array.isArray(object.resultSets)) - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); - message.resultSets = []; - for (var i = 0; i < object.resultSets.length; ++i) { - if (typeof object.resultSets[i] !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); - message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i]); + var message = new $root.google.spanner.v1.PartitionQueryRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.sql != null) + message.sql = String(object.sql); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.paramTypes) { + if (typeof object.paramTypes !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes = {}; + for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { + if (typeof object.paramTypes[keys[i]] !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); + message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); } } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); } return message; }; /** - * Creates a plain object from an ExecuteBatchDmlResponse message. Also converts values to other types if specified. + * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @memberof google.spanner.v1.PartitionQueryRequest * @static - * @param {google.spanner.v1.ExecuteBatchDmlResponse} message ExecuteBatchDmlResponse + * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteBatchDmlResponse.toObject = function toObject(message, options) { + PartitionQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.paramTypes = {}; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.sql = ""; + object.params = null; + object.partitionOptions = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + var keys2; + if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { + object.paramTypes = {}; + for (var j = 0; j < keys2.length; ++j) + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + return object; + }; + + /** + * Converts this PartitionQueryRequest to JSON. + * @function toJSON + * @memberof google.spanner.v1.PartitionQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PartitionQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionQueryRequest + * @function getTypeUrl + * @memberof google.spanner.v1.PartitionQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; + }; + + return PartitionQueryRequest; + })(); + + v1.PartitionReadRequest = (function() { + + /** + * Properties of a PartitionReadRequest. + * @memberof google.spanner.v1 + * @interface IPartitionReadRequest + * @property {string|null} [session] PartitionReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction + * @property {string|null} [table] PartitionReadRequest table + * @property {string|null} [index] PartitionReadRequest index + * @property {Array.|null} [columns] PartitionReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet + * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions + */ + + /** + * Constructs a new PartitionReadRequest. + * @memberof google.spanner.v1 + * @classdesc Represents a PartitionReadRequest. + * @implements IPartitionReadRequest + * @constructor + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + */ + function PartitionReadRequest(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionReadRequest session. + * @member {string} session + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.session = ""; + + /** + * PartitionReadRequest transaction. + * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.transaction = null; + + /** + * PartitionReadRequest table. + * @member {string} table + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.table = ""; + + /** + * PartitionReadRequest index. + * @member {string} index + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.index = ""; + + /** + * PartitionReadRequest columns. + * @member {Array.} columns + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.columns = $util.emptyArray; + + /** + * PartitionReadRequest keySet. + * @member {google.spanner.v1.IKeySet|null|undefined} keySet + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.keySet = null; + + /** + * PartitionReadRequest partitionOptions. + * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions + * @memberof google.spanner.v1.PartitionReadRequest + * @instance + */ + PartitionReadRequest.prototype.partitionOptions = null; + + /** + * Creates a new PartitionReadRequest instance using the specified properties. + * @function create + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance + */ + PartitionReadRequest.create = function create(properties) { + return new PartitionReadRequest(properties); + }; + + /** + * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.table = reader.string(); + break; + } + case 4: { + message.index = reader.string(); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 6: { + message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); + break; + } + case 9: { + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionReadRequest message. + * @function verify + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionReadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); + if (error) + return "transaction." + error; + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + if (message.columns != null && message.hasOwnProperty("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"; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) { + var error = $root.google.spanner.v1.KeySet.verify(message.keySet); + if (error) + return "keySet." + error; + } + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (error) + return "partitionOptions." + error; + } + return null; + }; + + /** + * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + */ + PartitionReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionReadRequest) + return object; + var message = new $root.google.spanner.v1.PartitionReadRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); + message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); + } + if (object.table != null) + message.table = String(object.table); + if (object.index != null) + message.index = String(object.index); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.keySet != null) { + if (typeof object.keySet !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); + message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + } + if (object.partitionOptions != null) { + if (typeof object.partitionOptions !== "object") + throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); + message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + } + return message; + }; + + /** + * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.PartitionReadRequest + * @static + * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionReadRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.resultSets = []; - if (options.defaults) - object.status = null; - if (message.resultSets && message.resultSets.length) { - object.resultSets = []; - for (var j = 0; j < message.resultSets.length; ++j) - object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + object.partitionOptions = null; } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); return object; }; /** - * Converts this ExecuteBatchDmlResponse to JSON. + * Converts this PartitionReadRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @memberof google.spanner.v1.PartitionReadRequest * @instance * @returns {Object.} JSON object */ - ExecuteBatchDmlResponse.prototype.toJSON = function toJSON() { + PartitionReadRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteBatchDmlResponse + * Gets the default type url for PartitionReadRequest * @function getTypeUrl - * @memberof google.spanner.v1.ExecuteBatchDmlResponse + * @memberof google.spanner.v1.PartitionReadRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteBatchDmlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.ExecuteBatchDmlResponse"; + return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; }; - return ExecuteBatchDmlResponse; + return PartitionReadRequest; })(); - v1.PartitionOptions = (function() { + v1.Partition = (function() { /** - * Properties of a PartitionOptions. + * Properties of a Partition. * @memberof google.spanner.v1 - * @interface IPartitionOptions - * @property {number|Long|null} [partitionSizeBytes] PartitionOptions partitionSizeBytes - * @property {number|Long|null} [maxPartitions] PartitionOptions maxPartitions + * @interface IPartition + * @property {Uint8Array|null} [partitionToken] Partition partitionToken */ /** - * Constructs a new PartitionOptions. + * Constructs a new Partition. * @memberof google.spanner.v1 - * @classdesc Represents a PartitionOptions. - * @implements IPartitionOptions + * @classdesc Represents a Partition. + * @implements IPartition * @constructor - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set + * @param {google.spanner.v1.IPartition=} [properties] Properties to set */ - function PartitionOptions(properties) { + function Partition(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45782,89 +50234,75 @@ } /** - * PartitionOptions partitionSizeBytes. - * @member {number|Long} partitionSizeBytes - * @memberof google.spanner.v1.PartitionOptions - * @instance - */ - PartitionOptions.prototype.partitionSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PartitionOptions maxPartitions. - * @member {number|Long} maxPartitions - * @memberof google.spanner.v1.PartitionOptions + * Partition partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.Partition * @instance */ - PartitionOptions.prototype.maxPartitions = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Partition.prototype.partitionToken = $util.newBuffer([]); /** - * Creates a new PartitionOptions instance using the specified properties. + * Creates a new Partition instance using the specified properties. * @function create - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static - * @param {google.spanner.v1.IPartitionOptions=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions instance + * @param {google.spanner.v1.IPartition=} [properties] Properties to set + * @returns {google.spanner.v1.Partition} Partition instance */ - PartitionOptions.create = function create(properties) { - return new PartitionOptions(properties); + Partition.create = function create(properties) { + return new Partition(properties); }; /** - * Encodes the specified PartitionOptions message. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionOptions.encode = function encode(message, writer) { + Partition.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); - if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxPartitions); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); return writer; }; /** - * Encodes the specified PartitionOptions message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionOptions.verify|verify} messages. + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static - * @param {google.spanner.v1.IPartitionOptions} message PartitionOptions message or plain object to encode + * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { + Partition.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartitionOptions message from the specified reader or buffer. + * Decodes a Partition message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @returns {google.spanner.v1.Partition} Partition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionOptions.decode = function decode(reader, length) { + Partition.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.partitionSizeBytes = reader.int64(); - break; - } - case 2: { - message.maxPartitions = reader.int64(); + message.partitionToken = reader.bytes(); break; } default: @@ -45876,165 +50314,133 @@ }; /** - * Decodes a PartitionOptions message from the specified reader or buffer, length delimited. + * Decodes a Partition message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @returns {google.spanner.v1.Partition} Partition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionOptions.decodeDelimited = function decodeDelimited(reader) { + Partition.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartitionOptions message. + * Verifies a Partition message. * @function verify - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartitionOptions.verify = function verify(message) { + Partition.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) - return "partitionSizeBytes: integer|Long expected"; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) - return "maxPartitions: integer|Long expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; return null; }; /** - * Creates a PartitionOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Partition message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionOptions} PartitionOptions + * @returns {google.spanner.v1.Partition} Partition */ - PartitionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionOptions) + Partition.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.Partition) return object; - var message = new $root.google.spanner.v1.PartitionOptions(); - if (object.partitionSizeBytes != null) - if ($util.Long) - (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; - else if (typeof object.partitionSizeBytes === "string") - message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); - else if (typeof object.partitionSizeBytes === "number") - message.partitionSizeBytes = object.partitionSizeBytes; - else if (typeof object.partitionSizeBytes === "object") - message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); - if (object.maxPartitions != null) - if ($util.Long) - (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; - else if (typeof object.maxPartitions === "string") - message.maxPartitions = parseInt(object.maxPartitions, 10); - else if (typeof object.maxPartitions === "number") - message.maxPartitions = object.maxPartitions; - else if (typeof object.maxPartitions === "object") - message.maxPartitions = new $util.LongBits(object.maxPartitions.low >>> 0, object.maxPartitions.high >>> 0).toNumber(); + var message = new $root.google.spanner.v1.Partition(); + if (object.partitionToken != null) + if (typeof object.partitionToken === "string") + $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); + else if (object.partitionToken.length >= 0) + message.partitionToken = object.partitionToken; return message; }; /** - * Creates a plain object from a PartitionOptions message. Also converts values to other types if specified. + * Creates a plain object from a Partition message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static - * @param {google.spanner.v1.PartitionOptions} message PartitionOptions + * @param {google.spanner.v1.Partition} message Partition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionOptions.toObject = function toObject(message, options) { + Partition.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.partitionSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxPartitions = options.longs === String ? "0" : 0; - } - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (typeof message.partitionSizeBytes === "number") - object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; - else - object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (typeof message.maxPartitions === "number") - object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; - else - object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; + if (options.defaults) + if (options.bytes === String) + object.partitionToken = ""; + else { + object.partitionToken = []; + if (options.bytes !== Array) + object.partitionToken = $util.newBuffer(object.partitionToken); + } + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; return object; }; /** - * Converts this PartitionOptions to JSON. + * Converts this Partition to JSON. * @function toJSON - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @instance * @returns {Object.} JSON object */ - PartitionOptions.prototype.toJSON = function toJSON() { + Partition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PartitionOptions + * Gets the default type url for Partition * @function getTypeUrl - * @memberof google.spanner.v1.PartitionOptions + * @memberof google.spanner.v1.Partition * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PartitionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.PartitionOptions"; + return typeUrlPrefix + "/google.spanner.v1.Partition"; }; - return PartitionOptions; + return Partition; })(); - v1.PartitionQueryRequest = (function() { + v1.PartitionResponse = (function() { /** - * Properties of a PartitionQueryRequest. + * Properties of a PartitionResponse. * @memberof google.spanner.v1 - * @interface IPartitionQueryRequest - * @property {string|null} [session] PartitionQueryRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionQueryRequest transaction - * @property {string|null} [sql] PartitionQueryRequest sql - * @property {google.protobuf.IStruct|null} [params] PartitionQueryRequest params - * @property {Object.|null} [paramTypes] PartitionQueryRequest paramTypes - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionQueryRequest partitionOptions + * @interface IPartitionResponse + * @property {Array.|null} [partitions] PartitionResponse partitions + * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction */ /** - * Constructs a new PartitionQueryRequest. + * Constructs a new PartitionResponse. * @memberof google.spanner.v1 - * @classdesc Represents a PartitionQueryRequest. - * @implements IPartitionQueryRequest + * @classdesc Represents a PartitionResponse. + * @implements IPartitionResponse * @constructor - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set */ - function PartitionQueryRequest(properties) { - this.paramTypes = {}; + function PartitionResponse(properties) { + this.partitions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46042,167 +50448,92 @@ } /** - * PartitionQueryRequest session. - * @member {string} session - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.session = ""; - - /** - * PartitionQueryRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.transaction = null; - - /** - * PartitionQueryRequest sql. - * @member {string} sql - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.sql = ""; - - /** - * PartitionQueryRequest params. - * @member {google.protobuf.IStruct|null|undefined} params - * @memberof google.spanner.v1.PartitionQueryRequest - * @instance - */ - PartitionQueryRequest.prototype.params = null; - - /** - * PartitionQueryRequest paramTypes. - * @member {Object.} paramTypes - * @memberof google.spanner.v1.PartitionQueryRequest + * PartitionResponse partitions. + * @member {Array.} partitions + * @memberof google.spanner.v1.PartitionResponse * @instance */ - PartitionQueryRequest.prototype.paramTypes = $util.emptyObject; + PartitionResponse.prototype.partitions = $util.emptyArray; /** - * PartitionQueryRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionQueryRequest + * PartitionResponse transaction. + * @member {google.spanner.v1.ITransaction|null|undefined} transaction + * @memberof google.spanner.v1.PartitionResponse * @instance */ - PartitionQueryRequest.prototype.partitionOptions = null; + PartitionResponse.prototype.transaction = null; /** - * Creates a new PartitionQueryRequest instance using the specified properties. + * Creates a new PartitionResponse instance using the specified properties. * @function create - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static - * @param {google.spanner.v1.IPartitionQueryRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest instance + * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance */ - PartitionQueryRequest.create = function create(properties) { - return new PartitionQueryRequest(properties); + PartitionResponse.create = function create(properties) { + return new PartitionResponse(properties); }; /** - * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionQueryRequest.encode = function encode(message, writer) { + PartitionResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.partitions != null && message.partitions.length) + for (var i = 0; i < message.partitions.length; ++i) + $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) - for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionQueryRequest.verify|verify} messages. + * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static - * @param {google.spanner.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * Decodes a PartitionResponse message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionQueryRequest.decode = function decode(reader, length) { + PartitionResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionQueryRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.session = reader.string(); + if (!(message.partitions && message.partitions.length)) + message.partitions = []; + message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); break; } case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sql = reader.string(); - break; - } - case 4: { - message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.paramTypes === $util.emptyObject) - message.paramTypes = {}; - 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.spanner.v1.Type.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.paramTypes[key] = value; - break; - } - case 6: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); break; } default: @@ -46214,204 +50545,164 @@ }; /** - * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { + PartitionResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartitionQueryRequest message. + * Verifies a PartitionResponse message. * @function verify - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartitionQueryRequest.verify = function verify(message) { + PartitionResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; - } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.google.protobuf.Struct.verify(message.params); - if (error) - return "params." + error; - } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { - if (!$util.isObject(message.paramTypes)) - return "paramTypes: object expected"; - var key = Object.keys(message.paramTypes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.spanner.v1.Type.verify(message.paramTypes[key[i]]); + if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (!Array.isArray(message.partitions)) + return "partitions: array expected"; + for (var i = 0; i < message.partitions.length; ++i) { + var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); if (error) - return "paramTypes." + error; + return "partitions." + error; } } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (message.transaction != null && message.hasOwnProperty("transaction")) { + var error = $root.google.spanner.v1.Transaction.verify(message.transaction); if (error) - return "partitionOptions." + error; + return "transaction." + error; } return null; }; /** - * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionQueryRequest} PartitionQueryRequest + * @returns {google.spanner.v1.PartitionResponse} PartitionResponse */ - PartitionQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) + PartitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.PartitionResponse) return object; - var message = new $root.google.spanner.v1.PartitionQueryRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.sql != null) - message.sql = String(object.sql); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); - message.params = $root.google.protobuf.Struct.fromObject(object.params); - } - if (object.paramTypes) { - if (typeof object.paramTypes !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes = {}; - for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { - if (typeof object.paramTypes[keys[i]] !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); - message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]]); + var message = new $root.google.spanner.v1.PartitionResponse(); + if (object.partitions) { + if (!Array.isArray(object.partitions)) + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); + message.partitions = []; + for (var i = 0; i < object.partitions.length; ++i) { + if (typeof object.partitions[i] !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); + message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); } } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); + if (object.transaction != null) { + if (typeof object.transaction !== "object") + throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); + message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); } return message; }; /** - * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. + * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static - * @param {google.spanner.v1.PartitionQueryRequest} message PartitionQueryRequest + * @param {google.spanner.v1.PartitionResponse} message PartitionResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionQueryRequest.toObject = function toObject(message, options) { + PartitionResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.paramTypes = {}; - if (options.defaults) { - object.session = ""; + if (options.arrays || options.defaults) + object.partitions = []; + if (options.defaults) object.transaction = null; - object.sql = ""; - object.params = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); - var keys2; - if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { - object.paramTypes = {}; - for (var j = 0; j < keys2.length; ++j) - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + if (message.partitions && message.partitions.length) { + object.partitions = []; + for (var j = 0; j < message.partitions.length; ++j) + object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); return object; }; /** - * Converts this PartitionQueryRequest to JSON. + * Converts this PartitionResponse to JSON. * @function toJSON - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @instance * @returns {Object.} JSON object */ - PartitionQueryRequest.prototype.toJSON = function toJSON() { + PartitionResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PartitionQueryRequest + * Gets the default type url for PartitionResponse * @function getTypeUrl - * @memberof google.spanner.v1.PartitionQueryRequest + * @memberof google.spanner.v1.PartitionResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PartitionQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.PartitionQueryRequest"; + return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; }; - return PartitionQueryRequest; + return PartitionResponse; })(); - v1.PartitionReadRequest = (function() { + v1.ReadRequest = (function() { /** - * Properties of a PartitionReadRequest. + * Properties of a ReadRequest. * @memberof google.spanner.v1 - * @interface IPartitionReadRequest - * @property {string|null} [session] PartitionReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] PartitionReadRequest transaction - * @property {string|null} [table] PartitionReadRequest table - * @property {string|null} [index] PartitionReadRequest index - * @property {Array.|null} [columns] PartitionReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] PartitionReadRequest keySet - * @property {google.spanner.v1.IPartitionOptions|null} [partitionOptions] PartitionReadRequest partitionOptions + * @interface IReadRequest + * @property {string|null} [session] ReadRequest session + * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction + * @property {string|null} [table] ReadRequest table + * @property {string|null} [index] ReadRequest index + * @property {Array.|null} [columns] ReadRequest columns + * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet + * @property {number|Long|null} [limit] ReadRequest limit + * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken + * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions + * @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ReadRequest directedReadOptions + * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled */ /** - * Constructs a new PartitionReadRequest. + * Constructs a new ReadRequest. * @memberof google.spanner.v1 - * @classdesc Represents a PartitionReadRequest. - * @implements IPartitionReadRequest + * @classdesc Represents a ReadRequest. + * @implements IReadRequest * @constructor - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set */ - function PartitionReadRequest(properties) { + function ReadRequest(properties) { this.columns = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -46420,83 +50711,123 @@ } /** - * PartitionReadRequest session. + * ReadRequest session. * @member {string} session - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.session = ""; + ReadRequest.prototype.session = ""; /** - * PartitionReadRequest transaction. + * ReadRequest transaction. * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.transaction = null; + ReadRequest.prototype.transaction = null; /** - * PartitionReadRequest table. + * ReadRequest table. * @member {string} table - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.table = ""; + ReadRequest.prototype.table = ""; /** - * PartitionReadRequest index. + * ReadRequest index. * @member {string} index - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.index = ""; + ReadRequest.prototype.index = ""; /** - * PartitionReadRequest columns. + * ReadRequest columns. * @member {Array.} columns - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.columns = $util.emptyArray; + ReadRequest.prototype.columns = $util.emptyArray; /** - * PartitionReadRequest keySet. + * ReadRequest keySet. * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.keySet = null; + ReadRequest.prototype.keySet = null; /** - * PartitionReadRequest partitionOptions. - * @member {google.spanner.v1.IPartitionOptions|null|undefined} partitionOptions - * @memberof google.spanner.v1.PartitionReadRequest + * ReadRequest limit. + * @member {number|Long} limit + * @memberof google.spanner.v1.ReadRequest * @instance */ - PartitionReadRequest.prototype.partitionOptions = null; + ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new PartitionReadRequest instance using the specified properties. + * ReadRequest resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.resumeToken = $util.newBuffer([]); + + /** + * ReadRequest partitionToken. + * @member {Uint8Array} partitionToken + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.partitionToken = $util.newBuffer([]); + + /** + * ReadRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.requestOptions = null; + + /** + * ReadRequest directedReadOptions. + * @member {google.spanner.v1.IDirectedReadOptions|null|undefined} directedReadOptions + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.directedReadOptions = null; + + /** + * ReadRequest dataBoostEnabled. + * @member {boolean} dataBoostEnabled + * @memberof google.spanner.v1.ReadRequest + * @instance + */ + ReadRequest.prototype.dataBoostEnabled = false; + + /** + * Creates a new ReadRequest instance using the specified properties. * @function create - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static - * @param {google.spanner.v1.IPartitionReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest instance + * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + * @returns {google.spanner.v1.ReadRequest} ReadRequest instance */ - PartitionReadRequest.create = function create(properties) { - return new PartitionReadRequest(properties); + ReadRequest.create = function create(properties) { + return new ReadRequest(properties); }; /** - * Encodes the specified PartitionReadRequest message. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionReadRequest.encode = function encode(message, writer) { + ReadRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.session != null && Object.hasOwnProperty.call(message, "session")) @@ -46512,39 +50843,49 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); return writer; }; /** - * Encodes the specified PartitionReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionReadRequest.verify|verify} messages. + * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static - * @param {google.spanner.v1.IPartitionReadRequest} message PartitionReadRequest message or plain object to encode + * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartitionReadRequest message from the specified reader or buffer. + * Decodes a ReadRequest message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @returns {google.spanner.v1.ReadRequest} ReadRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionReadRequest.decode = function decode(reader, length) { + ReadRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionReadRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -46574,8 +50915,28 @@ message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); break; } + case 8: { + message.limit = reader.int64(); + break; + } case 9: { - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.decode(reader, reader.uint32()); + message.resumeToken = reader.bytes(); + break; + } + case 10: { + message.partitionToken = reader.bytes(); + break; + } + case 11: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + break; + } + case 14: { + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.dataBoostEnabled = reader.bool(); break; } default: @@ -46587,30 +50948,30 @@ }; /** - * Decodes a PartitionReadRequest message from the specified reader or buffer, length delimited. + * Decodes a ReadRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @returns {google.spanner.v1.ReadRequest} ReadRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionReadRequest.decodeDelimited = function decodeDelimited(reader) { + ReadRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartitionReadRequest message. + * Verifies a ReadRequest message. * @function verify - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartitionReadRequest.verify = function verify(message) { + ReadRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.session != null && message.hasOwnProperty("session")) @@ -46639,31 +51000,48 @@ if (error) return "keySet." + error; } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { - var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions); + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) + return "partitionToken: buffer expected"; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); if (error) - return "partitionOptions." + error; + return "requestOptions." + error; } + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions); + if (error) + return "directedReadOptions." + error; + } + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (typeof message.dataBoostEnabled !== "boolean") + return "dataBoostEnabled: boolean expected"; return null; }; /** - * Creates a PartitionReadRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.PartitionReadRequest + * @memberof google.spanner.v1.ReadRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionReadRequest} PartitionReadRequest + * @returns {google.spanner.v1.ReadRequest} ReadRequest */ - PartitionReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionReadRequest) + ReadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.ReadRequest) return object; - var message = new $root.google.spanner.v1.PartitionReadRequest(); + var message = new $root.google.spanner.v1.ReadRequest(); if (object.session != null) message.session = String(object.session); if (object.transaction != null) { if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); + throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); } if (object.table != null) @@ -46672,267 +51050,83 @@ message.index = String(object.index); if (object.columns) { if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.PartitionReadRequest.columns: array expected"); + throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); message.columns = []; for (var i = 0; i < object.columns.length; ++i) message.columns[i] = String(object.columns[i]); } if (object.keySet != null) { if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); + throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); } - if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") - throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); - message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions); - } - return message; - }; - - /** - * Creates a plain object from a PartitionReadRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {google.spanner.v1.PartitionReadRequest} message PartitionReadRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartitionReadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - object.partitionOptions = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); - return object; - }; - - /** - * Converts this PartitionReadRequest to JSON. - * @function toJSON - * @memberof google.spanner.v1.PartitionReadRequest - * @instance - * @returns {Object.} JSON object - */ - PartitionReadRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PartitionReadRequest - * @function getTypeUrl - * @memberof google.spanner.v1.PartitionReadRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.spanner.v1.PartitionReadRequest"; - }; - - return PartitionReadRequest; - })(); - - v1.Partition = (function() { - - /** - * Properties of a Partition. - * @memberof google.spanner.v1 - * @interface IPartition - * @property {Uint8Array|null} [partitionToken] Partition partitionToken - */ - - /** - * Constructs a new Partition. - * @memberof google.spanner.v1 - * @classdesc Represents a Partition. - * @implements IPartition - * @constructor - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - */ - function Partition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Partition partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.Partition - * @instance - */ - Partition.prototype.partitionToken = $util.newBuffer([]); - - /** - * Creates a new Partition instance using the specified properties. - * @function create - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition=} [properties] Properties to set - * @returns {google.spanner.v1.Partition} Partition instance - */ - Partition.create = function create(properties) { - return new Partition(properties); - }; - - /** - * Encodes the specified Partition message. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encode - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); - return writer; - }; - - /** - * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.spanner.v1.Partition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {google.spanner.v1.IPartition} message Partition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Partition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Partition message from the specified reader or buffer. - * @function decode - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.Partition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.partitionToken = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Partition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.spanner.v1.Partition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.Partition} Partition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Partition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Partition message. - * @function verify - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Partition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; - return null; - }; - - /** - * Creates a Partition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.spanner.v1.Partition - * @static - * @param {Object.} object Plain object - * @returns {google.spanner.v1.Partition} Partition - */ - Partition.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.Partition) - return object; - var message = new $root.google.spanner.v1.Partition(); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); + if (object.resumeToken != null) + if (typeof object.resumeToken === "string") + $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); + else if (object.resumeToken.length >= 0) + message.resumeToken = object.resumeToken; if (object.partitionToken != null) if (typeof object.partitionToken === "string") $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); else if (object.partitionToken.length >= 0) message.partitionToken = object.partitionToken; + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); + } + if (object.directedReadOptions != null) { + if (typeof object.directedReadOptions !== "object") + throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); + message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions); + } + if (object.dataBoostEnabled != null) + message.dataBoostEnabled = Boolean(object.dataBoostEnabled); return message; }; /** - * Creates a plain object from a Partition message. Also converts values to other types if specified. + * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.Partition + * @memberof google.spanner.v1.ReadRequest * @static - * @param {google.spanner.v1.Partition} message Partition + * @param {google.spanner.v1.ReadRequest} message ReadRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Partition.toObject = function toObject(message, options) { + ReadRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.session = ""; + object.transaction = null; + object.table = ""; + object.index = ""; + object.keySet = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.resumeToken = ""; + else { + object.resumeToken = []; + if (options.bytes !== Array) + object.resumeToken = $util.newBuffer(object.resumeToken); + } if (options.bytes === String) object.partitionToken = ""; else { @@ -46940,60 +51134,92 @@ if (options.bytes !== Array) object.partitionToken = $util.newBuffer(object.partitionToken); } + object.requestOptions = null; + object.directedReadOptions = null; + object.dataBoostEnabled = false; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.keySet != null && message.hasOwnProperty("keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); + if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + object.dataBoostEnabled = message.dataBoostEnabled; return object; }; /** - * Converts this Partition to JSON. + * Converts this ReadRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.Partition + * @memberof google.spanner.v1.ReadRequest * @instance * @returns {Object.} JSON object */ - Partition.prototype.toJSON = function toJSON() { + ReadRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Partition + * Gets the default type url for ReadRequest * @function getTypeUrl - * @memberof google.spanner.v1.Partition + * @memberof google.spanner.v1.ReadRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.Partition"; + return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; }; - return Partition; + return ReadRequest; })(); - v1.PartitionResponse = (function() { + v1.BeginTransactionRequest = (function() { /** - * Properties of a PartitionResponse. + * Properties of a BeginTransactionRequest. * @memberof google.spanner.v1 - * @interface IPartitionResponse - * @property {Array.|null} [partitions] PartitionResponse partitions - * @property {google.spanner.v1.ITransaction|null} [transaction] PartitionResponse transaction + * @interface IBeginTransactionRequest + * @property {string|null} [session] BeginTransactionRequest session + * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions */ /** - * Constructs a new PartitionResponse. + * Constructs a new BeginTransactionRequest. * @memberof google.spanner.v1 - * @classdesc Represents a PartitionResponse. - * @implements IPartitionResponse + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest * @constructor - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set */ - function PartitionResponse(properties) { - this.partitions = []; + function BeginTransactionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47001,92 +51227,103 @@ } /** - * PartitionResponse partitions. - * @member {Array.} partitions - * @memberof google.spanner.v1.PartitionResponse + * BeginTransactionRequest session. + * @member {string} session + * @memberof google.spanner.v1.BeginTransactionRequest * @instance */ - PartitionResponse.prototype.partitions = $util.emptyArray; + BeginTransactionRequest.prototype.session = ""; /** - * PartitionResponse transaction. - * @member {google.spanner.v1.ITransaction|null|undefined} transaction - * @memberof google.spanner.v1.PartitionResponse + * BeginTransactionRequest options. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} options + * @memberof google.spanner.v1.BeginTransactionRequest * @instance */ - PartitionResponse.prototype.transaction = null; + BeginTransactionRequest.prototype.options = null; /** - * Creates a new PartitionResponse instance using the specified properties. + * BeginTransactionRequest requestOptions. + * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions + * @memberof google.spanner.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.requestOptions = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. * @function create - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static - * @param {google.spanner.v1.IPartitionResponse=} [properties] Properties to set - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse instance + * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance */ - PartitionResponse.create = function create(properties) { - return new PartitionResponse(properties); + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); }; /** - * Encodes the specified PartitionResponse message. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionResponse.encode = function encode(message, writer) { + BeginTransactionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.partitions != null && message.partitions.length) - for (var i = 0; i < message.partitions.length; ++i) - $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified PartitionResponse message, length delimited. Does not implicitly {@link google.spanner.v1.PartitionResponse.verify|verify} messages. + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static - * @param {google.spanner.v1.IPartitionResponse} message PartitionResponse message or plain object to encode + * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartitionResponse message from the specified reader or buffer. + * Decodes a BeginTransactionRequest message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionResponse.decode = function decode(reader, length) { + BeginTransactionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.PartitionResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.partitions && message.partitions.length)) - message.partitions = []; - message.partitions.push($root.google.spanner.v1.Partition.decode(reader, reader.uint32())); + message.session = reader.string(); break; } case 2: { - message.transaction = $root.google.spanner.v1.Transaction.decode(reader, reader.uint32()); + message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); break; } default: @@ -47098,164 +51335,155 @@ }; /** - * Decodes a PartitionResponse message from the specified reader or buffer, length delimited. + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionResponse.decodeDelimited = function decodeDelimited(reader) { + BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartitionResponse message. + * Verifies a BeginTransactionRequest message. * @function verify - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartitionResponse.verify = function verify(message) { + BeginTransactionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.partitions != null && message.hasOwnProperty("partitions")) { - if (!Array.isArray(message.partitions)) - return "partitions: array expected"; - for (var i = 0; i < message.partitions.length; ++i) { - var error = $root.google.spanner.v1.Partition.verify(message.partitions[i]); - if (error) - return "partitions." + error; - } + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); + if (error) + return "options." + error; } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.Transaction.verify(message.transaction); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); if (error) - return "transaction." + error; + return "requestOptions." + error; } return null; }; /** - * Creates a PartitionResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.PartitionResponse} PartitionResponse + * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest */ - PartitionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.PartitionResponse) + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) return object; - var message = new $root.google.spanner.v1.PartitionResponse(); - if (object.partitions) { - if (!Array.isArray(object.partitions)) - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); - message.partitions = []; - for (var i = 0; i < object.partitions.length; ++i) { - if (typeof object.partitions[i] !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); - message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i]); - } + var message = new $root.google.spanner.v1.BeginTransactionRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); + message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); } - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); - message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction); + if (object.requestOptions != null) { + if (typeof object.requestOptions !== "object") + throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); + message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); } return message; }; /** - * Creates a plain object from a PartitionResponse message. Also converts values to other types if specified. + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static - * @param {google.spanner.v1.PartitionResponse} message PartitionResponse + * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionResponse.toObject = function toObject(message, options) { + BeginTransactionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.partitions = []; - if (options.defaults) - object.transaction = null; - if (message.partitions && message.partitions.length) { - object.partitions = []; - for (var j = 0; j < message.partitions.length; ++j) - object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); + if (options.defaults) { + object.session = ""; + object.options = null; + object.requestOptions = null; } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); + if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); return object; }; /** - * Converts this PartitionResponse to JSON. + * Converts this BeginTransactionRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @instance * @returns {Object.} JSON object */ - PartitionResponse.prototype.toJSON = function toJSON() { + BeginTransactionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PartitionResponse + * Gets the default type url for BeginTransactionRequest * @function getTypeUrl - * @memberof google.spanner.v1.PartitionResponse + * @memberof google.spanner.v1.BeginTransactionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PartitionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.PartitionResponse"; + return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; }; - return PartitionResponse; + return BeginTransactionRequest; })(); - v1.ReadRequest = (function() { + v1.CommitRequest = (function() { /** - * Properties of a ReadRequest. + * Properties of a CommitRequest. * @memberof google.spanner.v1 - * @interface IReadRequest - * @property {string|null} [session] ReadRequest session - * @property {google.spanner.v1.ITransactionSelector|null} [transaction] ReadRequest transaction - * @property {string|null} [table] ReadRequest table - * @property {string|null} [index] ReadRequest index - * @property {Array.|null} [columns] ReadRequest columns - * @property {google.spanner.v1.IKeySet|null} [keySet] ReadRequest keySet - * @property {number|Long|null} [limit] ReadRequest limit - * @property {Uint8Array|null} [resumeToken] ReadRequest resumeToken - * @property {Uint8Array|null} [partitionToken] ReadRequest partitionToken - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ReadRequest requestOptions - * @property {boolean|null} [dataBoostEnabled] ReadRequest dataBoostEnabled + * @interface ICommitRequest + * @property {string|null} [session] CommitRequest session + * @property {Uint8Array|null} [transactionId] CommitRequest transactionId + * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction + * @property {Array.|null} [mutations] CommitRequest mutations + * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions */ /** - * Constructs a new ReadRequest. + * Constructs a new CommitRequest. * @memberof google.spanner.v1 - * @classdesc Represents a ReadRequest. - * @implements IReadRequest + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest * @constructor - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set */ - function ReadRequest(properties) { - this.columns = []; + function CommitRequest(properties) { + this.mutations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47263,171 +51491,135 @@ } /** - * ReadRequest session. + * CommitRequest session. * @member {string} session - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.session = ""; - - /** - * ReadRequest transaction. - * @member {google.spanner.v1.ITransactionSelector|null|undefined} transaction - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.transaction = null; - - /** - * ReadRequest table. - * @member {string} table - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.table = ""; - - /** - * ReadRequest index. - * @member {string} index - * @memberof google.spanner.v1.ReadRequest - * @instance - */ - ReadRequest.prototype.index = ""; - - /** - * ReadRequest columns. - * @member {Array.} columns - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.columns = $util.emptyArray; + CommitRequest.prototype.session = ""; /** - * ReadRequest keySet. - * @member {google.spanner.v1.IKeySet|null|undefined} keySet - * @memberof google.spanner.v1.ReadRequest + * CommitRequest transactionId. + * @member {Uint8Array|null|undefined} transactionId + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.keySet = null; + CommitRequest.prototype.transactionId = null; /** - * ReadRequest limit. - * @member {number|Long} limit - * @memberof google.spanner.v1.ReadRequest + * CommitRequest singleUseTransaction. + * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CommitRequest.prototype.singleUseTransaction = null; /** - * ReadRequest resumeToken. - * @member {Uint8Array} resumeToken - * @memberof google.spanner.v1.ReadRequest + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.resumeToken = $util.newBuffer([]); + CommitRequest.prototype.mutations = $util.emptyArray; /** - * ReadRequest partitionToken. - * @member {Uint8Array} partitionToken - * @memberof google.spanner.v1.ReadRequest + * CommitRequest returnCommitStats. + * @member {boolean} returnCommitStats + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.partitionToken = $util.newBuffer([]); + CommitRequest.prototype.returnCommitStats = false; /** - * ReadRequest requestOptions. + * CommitRequest requestOptions. * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.requestOptions = null; + CommitRequest.prototype.requestOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ReadRequest dataBoostEnabled. - * @member {boolean} dataBoostEnabled - * @memberof google.spanner.v1.ReadRequest + * CommitRequest transaction. + * @member {"transactionId"|"singleUseTransaction"|undefined} transaction + * @memberof google.spanner.v1.CommitRequest * @instance */ - ReadRequest.prototype.dataBoostEnabled = false; + Object.defineProperty(CommitRequest.prototype, "transaction", { + get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ReadRequest instance using the specified properties. + * Creates a new CommitRequest instance using the specified properties. * @function create - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static - * @param {google.spanner.v1.IReadRequest=} [properties] Properties to set - * @returns {google.spanner.v1.ReadRequest} ReadRequest instance + * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.spanner.v1.CommitRequest} CommitRequest instance */ - ReadRequest.create = function create(properties) { - return new ReadRequest(properties); + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); }; /** - * Encodes the specified ReadRequest message. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRequest.encode = function encode(message, writer) { + CommitRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.index); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); - if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); - if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.resumeToken); - if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) + $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadRequest message, length delimited. Does not implicitly {@link google.spanner.v1.ReadRequest.verify|verify} messages. + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static - * @param {google.spanner.v1.IReadRequest} message ReadRequest message or plain object to encode + * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadRequest message from the specified reader or buffer. + * Decodes a CommitRequest message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @returns {google.spanner.v1.CommitRequest} CommitRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRequest.decode = function decode(reader, length) { + CommitRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.ReadRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -47436,47 +51628,27 @@ break; } case 2: { - message.transaction = $root.google.spanner.v1.TransactionSelector.decode(reader, reader.uint32()); + message.transactionId = reader.bytes(); break; } case 3: { - message.table = reader.string(); + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); break; } case 4: { - message.index = reader.string(); + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); break; } case 5: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 6: { - message.keySet = $root.google.spanner.v1.KeySet.decode(reader, reader.uint32()); - break; - } - case 8: { - message.limit = reader.int64(); - break; - } - case 9: { - message.resumeToken = reader.bytes(); - break; - } - case 10: { - message.partitionToken = reader.bytes(); + message.returnCommitStats = reader.bool(); break; } - case 11: { + case 6: { message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); break; } - case 15: { - message.dataBoostEnabled = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -47486,265 +51658,207 @@ }; /** - * Decodes a ReadRequest message from the specified reader or buffer, length delimited. + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @returns {google.spanner.v1.CommitRequest} CommitRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRequest.decodeDelimited = function decodeDelimited(reader) { + CommitRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadRequest message. + * Verifies a CommitRequest message. * @function verify - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadRequest.verify = function verify(message) { + CommitRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.session != null && message.hasOwnProperty("session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { - var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction); - if (error) - return "transaction." + error; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + properties.transaction = 1; + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isString(message.index)) - return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("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"; + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + if (properties.transaction === 1) + return "transaction: multiple values"; + properties.transaction = 1; + { + var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); + if (error) + return "singleUseTransaction." + error; + } } - if (message.keySet != null && message.hasOwnProperty("keySet")) { - var error = $root.google.spanner.v1.KeySet.verify(message.keySet); - if (error) - return "keySet." + error; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) - return "resumeToken: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) - return "partitionToken: buffer expected"; + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + if (typeof message.returnCommitStats !== "boolean") + return "returnCommitStats: boolean expected"; if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); if (error) return "requestOptions." + error; } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - if (typeof message.dataBoostEnabled !== "boolean") - return "dataBoostEnabled: boolean expected"; return null; }; /** - * Creates a ReadRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.ReadRequest} ReadRequest + * @returns {google.spanner.v1.CommitRequest} CommitRequest */ - ReadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.ReadRequest) + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.CommitRequest) return object; - var message = new $root.google.spanner.v1.ReadRequest(); + var message = new $root.google.spanner.v1.CommitRequest(); if (object.session != null) message.session = String(object.session); - if (object.transaction != null) { - if (typeof object.transaction !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); - message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction); - } - if (object.table != null) - message.table = String(object.table); - if (object.index != null) - message.index = String(object.index); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.spanner.v1.ReadRequest.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; + if (object.singleUseTransaction != null) { + if (typeof object.singleUseTransaction !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); + message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); } - if (object.keySet != null) { - if (typeof object.keySet !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); - message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } } - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); - if (object.resumeToken != null) - if (typeof object.resumeToken === "string") - $util.base64.decode(object.resumeToken, message.resumeToken = $util.newBuffer($util.base64.length(object.resumeToken)), 0); - else if (object.resumeToken.length >= 0) - message.resumeToken = object.resumeToken; - if (object.partitionToken != null) - if (typeof object.partitionToken === "string") - $util.base64.decode(object.partitionToken, message.partitionToken = $util.newBuffer($util.base64.length(object.partitionToken)), 0); - else if (object.partitionToken.length >= 0) - message.partitionToken = object.partitionToken; + if (object.returnCommitStats != null) + message.returnCommitStats = Boolean(object.returnCommitStats); if (object.requestOptions != null) { if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); + throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); } - if (object.dataBoostEnabled != null) - message.dataBoostEnabled = Boolean(object.dataBoostEnabled); return message; }; /** - * Creates a plain object from a ReadRequest message. Also converts values to other types if specified. + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static - * @param {google.spanner.v1.ReadRequest} message ReadRequest + * @param {google.spanner.v1.CommitRequest} message CommitRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRequest.toObject = function toObject(message, options) { + CommitRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.columns = []; + object.mutations = []; if (options.defaults) { object.session = ""; - object.transaction = null; - object.table = ""; - object.index = ""; - object.keySet = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.resumeToken = ""; - else { - object.resumeToken = []; - if (options.bytes !== Array) - object.resumeToken = $util.newBuffer(object.resumeToken); - } - if (options.bytes === String) - object.partitionToken = ""; - else { - object.partitionToken = []; - if (options.bytes !== Array) - object.partitionToken = $util.newBuffer(object.partitionToken); - } + object.returnCommitStats = false; object.requestOptions = null; - object.dataBoostEnabled = false; } if (message.session != null && message.hasOwnProperty("session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + if (options.oneofs) + object.transaction = "transactionId"; } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) - object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) - object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; + if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); + if (options.oneofs) + object.transaction = "singleUseTransaction"; + } + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + object.returnCommitStats = message.returnCommitStats; if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) - object.dataBoostEnabled = message.dataBoostEnabled; return object; }; /** - * Converts this ReadRequest to JSON. + * Converts this CommitRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @instance * @returns {Object.} JSON object */ - ReadRequest.prototype.toJSON = function toJSON() { + CommitRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadRequest + * Gets the default type url for CommitRequest * @function getTypeUrl - * @memberof google.spanner.v1.ReadRequest + * @memberof google.spanner.v1.CommitRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.ReadRequest"; + return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; }; - return ReadRequest; + return CommitRequest; })(); - v1.BeginTransactionRequest = (function() { + v1.RollbackRequest = (function() { /** - * Properties of a BeginTransactionRequest. + * Properties of a RollbackRequest. * @memberof google.spanner.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [session] BeginTransactionRequest session - * @property {google.spanner.v1.ITransactionOptions|null} [options] BeginTransactionRequest options - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BeginTransactionRequest requestOptions + * @interface IRollbackRequest + * @property {string|null} [session] RollbackRequest session + * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId */ /** - * Constructs a new BeginTransactionRequest. + * Constructs a new RollbackRequest. * @memberof google.spanner.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest * @constructor - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set */ - function BeginTransactionRequest(properties) { + function RollbackRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47752,90 +51866,80 @@ } /** - * BeginTransactionRequest session. + * RollbackRequest session. * @member {string} session - * @memberof google.spanner.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.session = ""; - - /** - * BeginTransactionRequest options. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} options - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @instance */ - BeginTransactionRequest.prototype.options = null; + RollbackRequest.prototype.session = ""; /** - * BeginTransactionRequest requestOptions. - * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.BeginTransactionRequest + * RollbackRequest transactionId. + * @member {Uint8Array} transactionId + * @memberof google.spanner.v1.RollbackRequest * @instance */ - BeginTransactionRequest.prototype.requestOptions = null; + RollbackRequest.prototype.transactionId = $util.newBuffer([]); /** - * Creates a new BeginTransactionRequest instance using the specified properties. + * Creates a new RollbackRequest instance using the specified properties. * @function create - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static - * @param {google.spanner.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest instance + * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); }; /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BeginTransactionRequest.encode = function encode(message, writer) { + RollbackRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); return writer; }; /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BeginTransactionRequest.verify|verify} messages. + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static - * @param {google.spanner.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * Decodes a RollbackRequest message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BeginTransactionRequest.decode = function decode(reader, length) { + RollbackRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BeginTransactionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -47844,11 +51948,7 @@ break; } case 2: { - message.options = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + message.transactionId = reader.bytes(); break; } default: @@ -47860,155 +51960,143 @@ }; /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + RollbackRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BeginTransactionRequest message. + * Verifies a RollbackRequest message. * @function verify - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BeginTransactionRequest.verify = function verify(message) { + RollbackRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.session != null && message.hasOwnProperty("session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { - var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); - if (error) - return "requestOptions." + error; - } + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) + return "transactionId: buffer expected"; return null; }; /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.BeginTransactionRequest} BeginTransactionRequest + * @returns {google.spanner.v1.RollbackRequest} RollbackRequest */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.RollbackRequest) return object; - var message = new $root.google.spanner.v1.BeginTransactionRequest(); + var message = new $root.google.spanner.v1.RollbackRequest(); if (object.session != null) message.session = String(object.session); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); - message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options); - } - if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); - message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); - } + if (object.transactionId != null) + if (typeof object.transactionId === "string") + $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); + else if (object.transactionId.length >= 0) + message.transactionId = object.transactionId; return message; }; /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static - * @param {google.spanner.v1.BeginTransactionRequest} message BeginTransactionRequest + * @param {google.spanner.v1.RollbackRequest} message RollbackRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BeginTransactionRequest.toObject = function toObject(message, options) { + RollbackRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.session = ""; - object.options = null; - object.requestOptions = null; + if (options.bytes === String) + object.transactionId = ""; + else { + object.transactionId = []; + if (options.bytes !== Array) + object.transactionId = $util.newBuffer(object.transactionId); + } } if (message.session != null && message.hasOwnProperty("session")) object.session = message.session; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; return object; }; /** - * Converts this BeginTransactionRequest to JSON. + * Converts this RollbackRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @instance * @returns {Object.} JSON object */ - BeginTransactionRequest.prototype.toJSON = function toJSON() { + RollbackRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BeginTransactionRequest + * Gets the default type url for RollbackRequest * @function getTypeUrl - * @memberof google.spanner.v1.BeginTransactionRequest + * @memberof google.spanner.v1.RollbackRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BeginTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.BeginTransactionRequest"; + return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; }; - return BeginTransactionRequest; + return RollbackRequest; })(); - v1.CommitRequest = (function() { + v1.BatchWriteRequest = (function() { /** - * Properties of a CommitRequest. + * Properties of a BatchWriteRequest. * @memberof google.spanner.v1 - * @interface ICommitRequest - * @property {string|null} [session] CommitRequest session - * @property {Uint8Array|null} [transactionId] CommitRequest transactionId - * @property {google.spanner.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction - * @property {Array.|null} [mutations] CommitRequest mutations - * @property {boolean|null} [returnCommitStats] CommitRequest returnCommitStats - * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] CommitRequest requestOptions + * @interface IBatchWriteRequest + * @property {string|null} [session] BatchWriteRequest session + * @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions + * @property {Array.|null} [mutationGroups] BatchWriteRequest mutationGroups */ /** - * Constructs a new CommitRequest. + * Constructs a new BatchWriteRequest. * @memberof google.spanner.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest + * @classdesc Represents a BatchWriteRequest. + * @implements IBatchWriteRequest * @constructor - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set */ - function CommitRequest(properties) { - this.mutations = []; + function BatchWriteRequest(properties) { + this.mutationGroups = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48016,135 +52104,91 @@ } /** - * CommitRequest session. + * BatchWriteRequest session. * @member {string} session - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.session = ""; - - /** - * CommitRequest transactionId. - * @member {Uint8Array|null|undefined} transactionId - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.transactionId = null; - - /** - * CommitRequest singleUseTransaction. - * @member {google.spanner.v1.ITransactionOptions|null|undefined} singleUseTransaction - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.singleUseTransaction = null; - - /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.spanner.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mutations = $util.emptyArray; - - /** - * CommitRequest returnCommitStats. - * @member {boolean} returnCommitStats - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @instance */ - CommitRequest.prototype.returnCommitStats = false; + BatchWriteRequest.prototype.session = ""; /** - * CommitRequest requestOptions. + * BatchWriteRequest requestOptions. * @member {google.spanner.v1.IRequestOptions|null|undefined} requestOptions - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @instance */ - CommitRequest.prototype.requestOptions = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + BatchWriteRequest.prototype.requestOptions = null; /** - * CommitRequest transaction. - * @member {"transactionId"|"singleUseTransaction"|undefined} transaction - * @memberof google.spanner.v1.CommitRequest + * BatchWriteRequest mutationGroups. + * @member {Array.} mutationGroups + * @memberof google.spanner.v1.BatchWriteRequest * @instance */ - Object.defineProperty(CommitRequest.prototype, "transaction", { - get: $util.oneOfGetter($oneOfFields = ["transactionId", "singleUseTransaction"]), - set: $util.oneOfSetter($oneOfFields) - }); + BatchWriteRequest.prototype.mutationGroups = $util.emptyArray; /** - * Creates a new CommitRequest instance using the specified properties. + * Creates a new BatchWriteRequest instance using the specified properties. * @function create - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static - * @param {google.spanner.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.spanner.v1.CommitRequest} CommitRequest instance + * @param {google.spanner.v1.IBatchWriteRequest=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest instance */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); + BatchWriteRequest.create = function create(properties) { + return new BatchWriteRequest(properties); }; /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitRequest.encode = function encode(message, writer) { + BatchWriteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); - if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mutationGroups != null && message.mutationGroups.length) + for (var i = 0; i < message.mutationGroups.length; ++i) + $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.spanner.v1.CommitRequest.verify|verify} messages. + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static - * @param {google.spanner.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {google.spanner.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CommitRequest message from the specified reader or buffer. + * Decodes a BatchWriteRequest message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CommitRequest.decode = function decode(reader, length) { + BatchWriteRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.CommitRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -48152,26 +52196,14 @@ message.session = reader.string(); break; } - case 2: { - message.transactionId = reader.bytes(); - break; - } case 3: { - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.decode(reader, reader.uint32()); + message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); break; } case 4: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); - break; - } - case 5: { - message.returnCommitStats = reader.bool(); - break; - } - case 6: { - message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32()); + if (!(message.mutationGroups && message.mutationGroups.length)) + message.mutationGroups = []; + message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32())); break; } default: @@ -48183,207 +52215,389 @@ }; /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CommitRequest.decodeDelimited = function decodeDelimited(reader) { + BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CommitRequest message. + * Verifies a BatchWriteRequest message. * @function verify - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CommitRequest.verify = function verify(message) { + BatchWriteRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.session != null && message.hasOwnProperty("session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - properties.transaction = 1; - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - if (properties.transaction === 1) - return "transaction: multiple values"; - properties.transaction = 1; - { - var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUseTransaction); - if (error) - return "singleUseTransaction." + error; - } - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - if (typeof message.returnCommitStats !== "boolean") - return "returnCommitStats: boolean expected"; if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions); if (error) return "requestOptions." + error; } + if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { + if (!Array.isArray(message.mutationGroups)) + return "mutationGroups: array expected"; + for (var i = 0; i < message.mutationGroups.length; ++i) { + var error = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.verify(message.mutationGroups[i]); + if (error) + return "mutationGroups." + error; + } + } return null; }; /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.CommitRequest} CommitRequest + * @returns {google.spanner.v1.BatchWriteRequest} BatchWriteRequest */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.CommitRequest) + BatchWriteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest) return object; - var message = new $root.google.spanner.v1.CommitRequest(); + var message = new $root.google.spanner.v1.BatchWriteRequest(); if (object.session != null) message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; - if (object.singleUseTransaction != null) { - if (typeof object.singleUseTransaction !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); - message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction); - } - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); - } - } - if (object.returnCommitStats != null) - message.returnCommitStats = Boolean(object.returnCommitStats); if (object.requestOptions != null) { if (typeof object.requestOptions !== "object") - throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); + throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions); } + if (object.mutationGroups) { + if (!Array.isArray(object.mutationGroups)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); + message.mutationGroups = []; + for (var i = 0; i < object.mutationGroups.length; ++i) { + if (typeof object.mutationGroups[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); + message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]); + } + } return message; }; /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static - * @param {google.spanner.v1.CommitRequest} message CommitRequest + * @param {google.spanner.v1.BatchWriteRequest} message BatchWriteRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommitRequest.toObject = function toObject(message, options) { + BatchWriteRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.mutations = []; + object.mutationGroups = []; if (options.defaults) { object.session = ""; - object.returnCommitStats = false; object.requestOptions = null; } if (message.session != null && message.hasOwnProperty("session")) object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; - if (options.oneofs) - object.transaction = "transactionId"; - } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); - if (options.oneofs) - object.transaction = "singleUseTransaction"; - } - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); - } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) - object.returnCommitStats = message.returnCommitStats; if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.mutationGroups && message.mutationGroups.length) { + object.mutationGroups = []; + for (var j = 0; j < message.mutationGroups.length; ++j) + object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); + } return object; }; /** - * Converts this CommitRequest to JSON. + * Converts this BatchWriteRequest to JSON. * @function toJSON - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @instance * @returns {Object.} JSON object */ - CommitRequest.prototype.toJSON = function toJSON() { + BatchWriteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CommitRequest + * Gets the default type url for BatchWriteRequest * @function getTypeUrl - * @memberof google.spanner.v1.CommitRequest + * @memberof google.spanner.v1.BatchWriteRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.CommitRequest"; + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest"; }; - return CommitRequest; + BatchWriteRequest.MutationGroup = (function() { + + /** + * Properties of a MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @interface IMutationGroup + * @property {Array.|null} [mutations] MutationGroup mutations + */ + + /** + * Constructs a new MutationGroup. + * @memberof google.spanner.v1.BatchWriteRequest + * @classdesc Represents a MutationGroup. + * @implements IMutationGroup + * @constructor + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + */ + function MutationGroup(properties) { + this.mutations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutationGroup mutations. + * @member {Array.} mutations + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + */ + MutationGroup.prototype.mutations = $util.emptyArray; + + /** + * Creates a new MutationGroup instance using the specified properties. + * @function create + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup instance + */ + MutationGroup.create = function create(properties) { + return new MutationGroup(properties); + }; + + /** + * Encodes the specified MutationGroup message. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationGroup message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteRequest.MutationGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.IMutationGroup} message MutationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.spanner.v1.Mutation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutationGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutationGroup message. + * @function verify + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.spanner.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + return null; + }; + + /** + * Creates a MutationGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.v1.BatchWriteRequest.MutationGroup} MutationGroup + */ + MutationGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) + return object; + var message = new $root.google.spanner.v1.BatchWriteRequest.MutationGroup(); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); + message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MutationGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {google.spanner.v1.BatchWriteRequest.MutationGroup} message MutationGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + } + return object; + }; + + /** + * Converts this MutationGroup to JSON. + * @function toJSON + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @instance + * @returns {Object.} JSON object + */ + MutationGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutationGroup + * @function getTypeUrl + * @memberof google.spanner.v1.BatchWriteRequest.MutationGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.v1.BatchWriteRequest.MutationGroup"; + }; + + return MutationGroup; + })(); + + return BatchWriteRequest; })(); - v1.RollbackRequest = (function() { + v1.BatchWriteResponse = (function() { /** - * Properties of a RollbackRequest. + * Properties of a BatchWriteResponse. * @memberof google.spanner.v1 - * @interface IRollbackRequest - * @property {string|null} [session] RollbackRequest session - * @property {Uint8Array|null} [transactionId] RollbackRequest transactionId + * @interface IBatchWriteResponse + * @property {Array.|null} [indexes] BatchWriteResponse indexes + * @property {google.rpc.IStatus|null} [status] BatchWriteResponse status + * @property {google.protobuf.ITimestamp|null} [commitTimestamp] BatchWriteResponse commitTimestamp */ /** - * Constructs a new RollbackRequest. + * Constructs a new BatchWriteResponse. * @memberof google.spanner.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest + * @classdesc Represents a BatchWriteResponse. + * @implements IBatchWriteResponse * @constructor - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set */ - function RollbackRequest(properties) { + function BatchWriteResponse(properties) { + this.indexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48391,89 +52605,114 @@ } /** - * RollbackRequest session. - * @member {string} session - * @memberof google.spanner.v1.RollbackRequest + * BatchWriteResponse indexes. + * @member {Array.} indexes + * @memberof google.spanner.v1.BatchWriteResponse * @instance */ - RollbackRequest.prototype.session = ""; + BatchWriteResponse.prototype.indexes = $util.emptyArray; /** - * RollbackRequest transactionId. - * @member {Uint8Array} transactionId - * @memberof google.spanner.v1.RollbackRequest + * BatchWriteResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.spanner.v1.BatchWriteResponse * @instance */ - RollbackRequest.prototype.transactionId = $util.newBuffer([]); + BatchWriteResponse.prototype.status = null; /** - * Creates a new RollbackRequest instance using the specified properties. + * BatchWriteResponse commitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} commitTimestamp + * @memberof google.spanner.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.commitTimestamp = null; + + /** + * Creates a new BatchWriteResponse instance using the specified properties. * @function create - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static - * @param {google.spanner.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest instance + * @param {google.spanner.v1.IBatchWriteResponse=} [properties] Properties to set + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse instance */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); + BatchWriteResponse.create = function create(properties) { + return new BatchWriteResponse(properties); }; /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. * @function encode - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollbackRequest.encode = function encode(message, writer) { + BatchWriteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); + if (message.indexes != null && message.indexes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.indexes.length; ++i) + writer.int32(message.indexes[i]); + writer.ldelim(); + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.spanner.v1.RollbackRequest.verify|verify} messages. + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.spanner.v1.BatchWriteResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static - * @param {google.spanner.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {google.spanner.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RollbackRequest message from the specified reader or buffer. + * Decodes a BatchWriteResponse message from the specified reader or buffer. * @function decode - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollbackRequest.decode = function decode(reader, length) { + BatchWriteResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.RollbackRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.v1.BatchWriteResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.session = reader.string(); + if (!(message.indexes && message.indexes.length)) + message.indexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.indexes.push(reader.int32()); + } else + message.indexes.push(reader.int32()); break; } case 2: { - message.transactionId = reader.bytes(); + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.commitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -48485,120 +52724,142 @@ }; /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RollbackRequest.decodeDelimited = function decodeDelimited(reader) { + BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RollbackRequest message. + * Verifies a BatchWriteResponse message. * @function verify - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RollbackRequest.verify = function verify(message) { + BatchWriteResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) - return "transactionId: buffer expected"; + if (message.indexes != null && message.hasOwnProperty("indexes")) { + if (!Array.isArray(message.indexes)) + return "indexes: array expected"; + for (var i = 0; i < message.indexes.length; ++i) + if (!$util.isInteger(message.indexes[i])) + return "indexes: integer[] expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp); + if (error) + return "commitTimestamp." + error; + } return null; }; /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static * @param {Object.} object Plain object - * @returns {google.spanner.v1.RollbackRequest} RollbackRequest + * @returns {google.spanner.v1.BatchWriteResponse} BatchWriteResponse */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.v1.RollbackRequest) + BatchWriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.v1.BatchWriteResponse) return object; - var message = new $root.google.spanner.v1.RollbackRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.transactionId != null) - if (typeof object.transactionId === "string") - $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0); - else if (object.transactionId.length >= 0) - message.transactionId = object.transactionId; + var message = new $root.google.spanner.v1.BatchWriteResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.spanner.v1.BatchWriteResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) + message.indexes[i] = object.indexes[i] | 0; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.commitTimestamp != null) { + if (typeof object.commitTimestamp !== "object") + throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); + message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp); + } return message; }; /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static - * @param {google.spanner.v1.RollbackRequest} message RollbackRequest + * @param {google.spanner.v1.BatchWriteResponse} message BatchWriteResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollbackRequest.toObject = function toObject(message, options) { + BatchWriteResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.indexes = []; if (options.defaults) { - object.session = ""; - if (options.bytes === String) - object.transactionId = ""; - else { - object.transactionId = []; - if (options.bytes !== Array) - object.transactionId = $util.newBuffer(object.transactionId); - } + object.status = null; + object.commitTimestamp = null; } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = message.indexes[j]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); return object; }; /** - * Converts this RollbackRequest to JSON. + * Converts this BatchWriteResponse to JSON. * @function toJSON - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @instance * @returns {Object.} JSON object */ - RollbackRequest.prototype.toJSON = function toJSON() { + BatchWriteResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RollbackRequest + * Gets the default type url for BatchWriteResponse * @function getTypeUrl - * @memberof google.spanner.v1.RollbackRequest + * @memberof google.spanner.v1.BatchWriteResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RollbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.v1.RollbackRequest"; + return typeUrlPrefix + "/google.spanner.v1.BatchWriteResponse"; }; - return RollbackRequest; + return BatchWriteResponse; })(); return v1; @@ -51102,6 +55363,7 @@ * @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 */ /** @@ -51194,6 +55456,14 @@ */ Publishing.prototype.librarySettings = $util.emptyArray; + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + /** * Creates a new Publishing instance using the specified properties. * @function create @@ -51239,6 +55509,8 @@ 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()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); return writer; }; @@ -51315,6 +55587,10 @@ message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); break; } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -51390,6 +55666,9 @@ case 2: case 3: case 4: + case 5: + case 6: + case 7: break; } if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { @@ -51401,6 +55680,9 @@ return "librarySettings." + error; } } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; return null; }; @@ -51470,6 +55752,18 @@ 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)) @@ -51481,6 +55775,8 @@ message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); } } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); return message; }; @@ -51509,6 +55805,7 @@ object.githubLabel = ""; object.docTagPrefix = ""; object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; } if (message.methodSettings && message.methodSettings.length) { object.methodSettings = []; @@ -51537,6 +55834,8 @@ for (var j = 0; j < message.librarySettings.length; ++j) object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; return object; }; @@ -52699,6 +56998,11 @@ * @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 */ /** @@ -52710,6 +57014,11 @@ * @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) @@ -52724,6 +57033,46 @@ */ 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 @@ -52750,6 +57099,21 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).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; }; @@ -52780,7 +57144,7 @@ DotnetSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + 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(); switch (tag >>> 3) { @@ -52788,6 +57152,70 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); 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); + break; + } + } + 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); + break; + } + } + 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); break; @@ -52828,6 +57256,43 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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; }; @@ -52848,6 +57313,41 @@ throw TypeError(".google.api.DotnetSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++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; }; @@ -52864,10 +57364,45 @@ if (!options) options = {}; 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 && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++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) + 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; }; @@ -53845,6 +58380,9 @@ * @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); @@ -53853,6 +58391,9 @@ 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; })(); diff --git a/protos/protos.json b/protos/protos.json index a1e9da641..64a1319ec 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -191,6 +191,25 @@ "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" + } } }, "extensions": [ @@ -198,7 +217,45 @@ 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": { "fields": { @@ -511,6 +568,10 @@ "type": "string", "id": 45 }, + "features": { + "type": "FeatureSet", + "id": 50 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -573,6 +634,10 @@ "deprecated": true } }, + "features": { + "type": "FeatureSet", + "id": 12 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -667,9 +732,22 @@ "type": "OptionRetention", "id": 17 }, - "target": { + "targets": { + "rule": "repeated", "type": "OptionTargetType", - "id": 18 + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 }, "uninterpretedOption": { "rule": "repeated", @@ -687,6 +765,10 @@ [ 4, 4 + ], + [ + 18, + 18 ] ], "nested": { @@ -724,11 +806,27 @@ "TARGET_TYPE_SERVICE": 8, "TARGET_TYPE_METHOD": 9 } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } } } }, "OneofOptions": { "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -762,6 +860,10 @@ "deprecated": true } }, + "features": { + "type": "FeatureSet", + "id": 7 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -790,6 +892,17 @@ "default": false } }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -805,6 +918,10 @@ }, "ServiceOptions": { "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, "deprecated": { "type": "bool", "id": 33, @@ -841,6 +958,10 @@ "default": "IDEMPOTENCY_UNKNOWN" } }, + "features": { + "type": "FeatureSet", + "id": 35 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -912,6 +1033,137 @@ } } }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "PACKED" + } + }, + "stringFieldValidation": { + "type": "StringFieldValidation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "MANDATORY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "2023", + "edition_defaults.value": "ALLOW" + } + }, + "rawFeatures": { + "type": "FeatureSet", + "id": 999, + "options": { + "targets": "TARGET_TYPE_UNKNOWN" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 9995, + 9999 + ] + ], + "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 + } + }, + "StringFieldValidation": { + "values": { + "STRING_FIELD_VALIDATION_UNKNOWN": 0, + "MANDATORY": 1, + "HINT": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, "SourceCodeInfo": { "fields": { "location": { @@ -3300,6 +3552,78 @@ } } }, + "AutoscalingConfig": { + "fields": { + "autoscalingLimits": { + "type": "AutoscalingLimits", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoscalingTargets": { + "type": "AutoscalingTargets", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "AutoscalingLimits": { + "oneofs": { + "minLimit": { + "oneof": [ + "minNodes", + "minProcessingUnits" + ] + }, + "maxLimit": { + "oneof": [ + "maxNodes", + "maxProcessingUnits" + ] + } + }, + "fields": { + "minNodes": { + "type": "int32", + "id": 1 + }, + "minProcessingUnits": { + "type": "int32", + "id": 2 + }, + "maxNodes": { + "type": "int32", + "id": 3 + }, + "maxProcessingUnits": { + "type": "int32", + "id": 4 + } + } + }, + "AutoscalingTargets": { + "fields": { + "highPriorityCpuUtilizationPercent": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "storageUtilizationPercent": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "Instance": { "options": { "(google.api.resource).type": "spanner.googleapis.com/Instance", @@ -3336,6 +3660,13 @@ "type": "int32", "id": 9 }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "state": { "type": "State", "id": 6, @@ -4238,7 +4569,8 @@ "values": { "TYPE_ANNOTATION_CODE_UNSPECIFIED": 0, "PG_NUMERIC": 2, - "PG_JSONB": 3 + "PG_JSONB": 3, + "PG_OID": 4 } }, "Spanner": { @@ -4517,6 +4849,27 @@ } } ] + }, + "BatchWrite": { + "requestType": "BatchWriteRequest", + "responseType": "BatchWriteResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,mutation_groups" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,mutation_groups" + } + ] } } }, @@ -4696,6 +5049,71 @@ } } }, + "DirectedReadOptions": { + "oneofs": { + "replicas": { + "oneof": [ + "includeReplicas", + "excludeReplicas" + ] + } + }, + "fields": { + "includeReplicas": { + "type": "IncludeReplicas", + "id": 1 + }, + "excludeReplicas": { + "type": "ExcludeReplicas", + "id": 2 + } + }, + "nested": { + "ReplicaSelection": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2 + } + } + } + }, + "IncludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + }, + "autoFailoverDisabled": { + "type": "bool", + "id": 2 + } + } + }, + "ExcludeReplicas": { + "fields": { + "replicaSelections": { + "rule": "repeated", + "type": "ReplicaSelection", + "id": 1 + } + } + } + } + }, "ExecuteSqlRequest": { "fields": { "session": { @@ -4750,6 +5168,10 @@ "type": "RequestOptions", "id": 11 }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 15 + }, "dataBoostEnabled": { "type": "bool", "id": 16 @@ -5018,6 +5440,10 @@ "type": "RequestOptions", "id": 11 }, + "directedReadOptions": { + "type": "DirectedReadOptions", + "id": 14 + }, "dataBoostEnabled": { "type": "bool", "id": 15 @@ -5106,6 +5532,61 @@ } } } + }, + "BatchWriteRequest": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "spanner.googleapis.com/Session" + } + }, + "requestOptions": { + "type": "RequestOptions", + "id": 3 + }, + "mutationGroups": { + "rule": "repeated", + "type": "MutationGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "MutationGroup": { + "fields": { + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "BatchWriteResponse": { + "fields": { + "indexes": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "commitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } } } } @@ -5423,6 +5904,10 @@ "rule": "repeated", "type": "ClientLibrarySettings", "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 } } }, @@ -5480,6 +5965,31 @@ "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 } } }, @@ -5539,7 +6049,10 @@ "CLOUD": 1, "ADS": 2, "PHOTOS": 3, - "STREET_VIEW": 4 + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 } }, "ClientLibraryDestination": { @@ -5567,7 +6080,7 @@ "options": { "cc_enable_arenas": true, "csharp_namespace": "Google.LongRunning", - "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", @@ -5785,7 +6298,7 @@ "options": { "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", "java_multiple_files": true, "java_outer_classname": "PolicyProto", "java_package": "com.google.iam.v1", diff --git a/samples/dml.js b/samples/dml.js index 4ab57147f..dface9327 100644 --- a/samples/dml.js +++ b/samples/dml.js @@ -649,12 +649,11 @@ async function insertWithCustomTimeoutAndRetrySettings( const spanner = new Spanner({ projectId: projectId, }); - const DEADLINE_EXCEEDED_STATUS_CODE = 4; const UNAVAILABLE_STATUS_CODE = 14; const retryAndTimeoutSettings = { retry: { // The set of error codes that will be retried. - retryCodes: [DEADLINE_EXCEEDED_STATUS_CODE, UNAVAILABLE_STATUS_CODE], + retryCodes: [UNAVAILABLE_STATUS_CODE], backoffSettings: { // Configure retry delay settings. // The initial amount of time to wait before retrying the request. @@ -662,7 +661,7 @@ async function insertWithCustomTimeoutAndRetrySettings( // The maximum amount of time to wait before retrying. I.e. after this // value is reached, the wait time will not increase further by the // multiplier. - maxRetryDelayMillis: 64000, + maxRetryDelayMillis: 16000, // The previous wait time is multiplied by this multiplier to come up // with the next wait time, until the max is reached. retryDelayMultiplier: 1.5, diff --git a/samples/instance-config-create.js b/samples/instance-config-create.js index 362e1b928..7ae6cccff 100644 --- a/samples/instance-config-create.js +++ b/samples/instance-config-create.js @@ -44,9 +44,8 @@ function main( // Creates a new instance config const instanceConfig = spanner.instanceConfig(instanceConfigId); try { - const [baseInstanceConfig] = await spanner.getInstanceConfig( - baseInstanceConfigId - ); + const [baseInstanceConfig] = + await spanner.getInstanceConfig(baseInstanceConfigId); console.log(`Creating instance config ${instanceConfig.formattedName_}.`); const [, operation] = await instanceConfig.create({ displayName: instanceConfigId, diff --git a/samples/package.json b/samples/package.json index c384ec6b4..517d392bb 100644 --- a/samples/package.json +++ b/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/kms": "^4.0.0", "@google-cloud/precise-date": "^3.0.0", - "@google-cloud/spanner": "^7.0.0", + "@google-cloud/spanner": "^7.1.0", "yargs": "^17.0.0" }, "devDependencies": { diff --git a/src/v1/database_admin_client.ts b/src/v1/database_admin_client.ts index a1fb3a72f..0878c545a 100644 --- a/src/v1/database_admin_client.ts +++ b/src/v1/database_admin_client.ts @@ -99,8 +99,7 @@ export class DatabaseAdminClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @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 @@ -108,7 +107,7 @@ export class DatabaseAdminClient { * 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 DatabaseAdminClient({fallback: 'rest'}, gax); + * const client = new DatabaseAdminClient({fallback: true}, gax); * ``` */ constructor( @@ -174,7 +173,7 @@ export class DatabaseAdminClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -243,7 +242,7 @@ export class DatabaseAdminClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { @@ -534,9 +533,8 @@ export class DatabaseAdminClient { * @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 google.spanner.admin.database.v1.Database | Database}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Database|Database}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getDatabase( @@ -627,9 +625,8 @@ export class DatabaseAdminClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ dropDatabase( @@ -709,7 +706,7 @@ export class DatabaseAdminClient { /** * Returns the schema of a Cloud Spanner database as a list of formatted * DDL statements. This method does not show pending schema updates, those may - * be queried using the {@link google.longrunning.Operations|Operations} API. + * be queried using the {@link protos.google.longrunning.Operations|Operations} API. * * @param {Object} request * The request object that will be sent. @@ -720,9 +717,8 @@ export class DatabaseAdminClient { * @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 google.spanner.admin.database.v1.GetDatabaseDdlResponse | GetDatabaseDdlResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse|GetDatabaseDdlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getDatabaseDdl( @@ -810,9 +806,9 @@ export class DatabaseAdminClient { * Replaces any existing policy. * * Authorization requires `spanner.databases.setIamPolicy` - * permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}. + * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. * For backups, authorization requires `spanner.backups.setIamPolicy` - * permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}. + * permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. * * @param {Object} request * The request object that will be sent. @@ -833,9 +829,8 @@ export class DatabaseAdminClient { * @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 google.iam.v1.Policy | Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ setIamPolicy( @@ -910,9 +905,9 @@ export class DatabaseAdminClient { * policy set. * * Authorization requires `spanner.databases.getIamPolicy` permission on - * {@link google.iam.v1.GetIamPolicyRequest.resource|resource}. + * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. * For backups, authorization requires `spanner.backups.getIamPolicy` - * permission on {@link google.iam.v1.GetIamPolicyRequest.resource|resource}. + * permission on {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. * * @param {Object} request * The request object that will be sent. @@ -925,9 +920,8 @@ export class DatabaseAdminClient { * @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 google.iam.v1.Policy | Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getIamPolicy( @@ -1021,9 +1015,8 @@ export class DatabaseAdminClient { * @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 google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ testIamPermissions( @@ -1093,7 +1086,7 @@ export class DatabaseAdminClient { return this.innerApiCalls.testIamPermissions(request, options, callback); } /** - * Gets metadata on a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}. + * Gets metadata on a pending or completed {@link protos.google.spanner.admin.database.v1.Backup|Backup}. * * @param {Object} request * The request object that will be sent. @@ -1104,9 +1097,8 @@ export class DatabaseAdminClient { * @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 google.spanner.admin.database.v1.Backup | Backup}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getBackup( @@ -1184,7 +1176,7 @@ export class DatabaseAdminClient { return this.innerApiCalls.getBackup(request, options, callback); } /** - * Updates a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}. + * Updates a pending or completed {@link protos.google.spanner.admin.database.v1.Backup|Backup}. * * @param {Object} request * The request object that will be sent. @@ -1202,9 +1194,8 @@ export class DatabaseAdminClient { * @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 google.spanner.admin.database.v1.Backup | Backup}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ updateBackup( @@ -1282,7 +1273,7 @@ export class DatabaseAdminClient { return this.innerApiCalls.updateBackup(request, options, callback); } /** - * Deletes a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}. + * Deletes a pending or completed {@link protos.google.spanner.admin.database.v1.Backup|Backup}. * * @param {Object} request * The request object that will be sent. @@ -1293,9 +1284,8 @@ export class DatabaseAdminClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ deleteBackup( @@ -1375,13 +1365,13 @@ export class DatabaseAdminClient { /** * Creates a new Cloud Spanner database and starts to prepare it for serving. - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format `/operations/` and * can be used to track preparation of the database. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. The - * {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.database.v1.Database|Database}, if successful. + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. The + * {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. * * @param {Object} request * The request object that will be sent. @@ -1391,7 +1381,7 @@ export class DatabaseAdminClient { * @param {string} request.createStatement * Required. A `CREATE DATABASE` statement, which specifies the ID of the * new database. The database ID must conform to the regular expression - * `{@link a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length. + * `{@link protos.a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length. * If the database ID is a reserved word or if it contains a hyphen, the * database ID must be enclosed in backticks (`` ` ``). * @param {string[]} [request.extraStatements] @@ -1411,8 +1401,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ createDatabase( @@ -1505,8 +1494,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkCreateDatabaseProgress( @@ -1534,18 +1522,18 @@ export class DatabaseAdminClient { } /** * Updates a Cloud Spanner database. The returned - * {@link google.longrunning.Operation|long-running operation} can be used to track + * {@link protos.google.longrunning.Operation|long-running operation} can be used to track * the progress of updating the database. If the named database does not * exist, returns `NOT_FOUND`. * * While the operation is pending: * * * The database's - * {@link google.spanner.admin.database.v1.Database.reconciling|reconciling} + * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} * field is set to true. * * Cancelling the operation is best-effort. If the cancellation succeeds, * the operation metadata's - * {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|cancel_time} + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|cancel_time} * is set, the updates are reverted, and the operation terminates with a * `CANCELLED` status. * * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error @@ -1558,17 +1546,17 @@ export class DatabaseAdminClient { * * * The new values are in effect and readable via the API. * * The database's - * {@link google.spanner.admin.database.v1.Database.reconciling|reconciling} + * {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling} * field becomes false. * - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format * `projects//instances//databases//operations/` * and can be used to track the database modification. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.database.v1.Database|Database}, if successful. + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful. * * @param {Object} request * The request object that will be sent. @@ -1585,8 +1573,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ updateDatabase( @@ -1679,8 +1666,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkUpdateDatabaseProgress( @@ -1709,11 +1695,11 @@ export class DatabaseAdminClient { /** * Updates the schema of a Cloud Spanner database by * creating/altering/dropping tables, columns, indexes, etc. The returned - * {@link google.longrunning.Operation|long-running operation} will have a name of + * {@link protos.google.longrunning.Operation|long-running operation} will have a name of * the format `/operations/` and can be used to * track execution of the schema change(s). The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. The operation has no response. + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. The operation has no response. * * @param {Object} request * The request object that will be sent. @@ -1725,21 +1711,21 @@ export class DatabaseAdminClient { * If empty, the new update request is assigned an * automatically-generated operation ID. Otherwise, `operation_id` * is used to construct the name of the resulting - * {@link google.longrunning.Operation|Operation}. + * {@link protos.google.longrunning.Operation|Operation}. * * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} call is replayed, - * or the return value is otherwise lost: the {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} and + * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} call is replayed, + * or the return value is otherwise lost: the {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} and * `operation_id` fields can be combined to form the - * {@link google.longrunning.Operation.name|name} of the resulting - * {@link google.longrunning.Operation|longrunning.Operation}: `/operations/`. + * {@link protos.google.longrunning.Operation.name|name} of the resulting + * {@link protos.google.longrunning.Operation|longrunning.Operation}: `/operations/`. * * `operation_id` should be unique within the database, and must be - * a valid identifier: `{@link a-z0-9_|a-z}*`. Note that + * a valid identifier: `{@link protos.a-z0-9_|a-z}*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} returns + * {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} returns * `ALREADY_EXISTS`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1747,8 +1733,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ updateDatabaseDdl( @@ -1841,8 +1826,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkUpdateDatabaseDdlProgress( @@ -1870,14 +1854,14 @@ export class DatabaseAdminClient { } /** * Starts creating a new Cloud Spanner Backup. - * The returned backup {@link google.longrunning.Operation|long-running operation} + * The returned backup {@link protos.google.longrunning.Operation|long-running operation} * will have a name of the format * `projects//instances//backups//operations/` * and can be used to track creation of the backup. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. The - * {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. The + * {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the * creation and delete the backup. * There can be only one pending backup creation per database. Backup creation * of different databases can run concurrently. @@ -1901,7 +1885,7 @@ export class DatabaseAdminClient { * Optional. The encryption configuration used to encrypt the backup. If this field is * not specified, the backup will use the same * encryption configuration as the database by default, namely - * {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} = + * {@link protos.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} = * `USE_DATABASE_ENCRYPTION`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1909,8 +1893,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ createBackup( @@ -2003,8 +1986,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkCreateBackupProgress( @@ -2032,15 +2014,15 @@ export class DatabaseAdminClient { } /** * Starts copying a Cloud Spanner Backup. - * The returned backup {@link google.longrunning.Operation|long-running operation} + * The returned backup {@link protos.google.longrunning.Operation|long-running operation} * will have a name of the format * `projects//instances//backups//operations/` * and can be used to track copying of the backup. The operation is associated * with the destination backup. - * The {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the + * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the * copying and delete the backup. * Concurrent CopyBackup requests can run on the same source backup. * @@ -2070,7 +2052,7 @@ export class DatabaseAdminClient { * Optional. The encryption configuration used to encrypt the backup. If this field is * not specified, the backup will use the same * encryption configuration as the source backup by default, namely - * {@link google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type|encryption_type} = + * {@link protos.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type|encryption_type} = * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -2078,8 +2060,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ copyBackup( @@ -2172,8 +2153,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkCopyBackupProgress( @@ -2207,10 +2187,10 @@ export class DatabaseAdminClient { * operation][google.longrunning.Operation] has a name of the format * `projects//instances//databases//operations/`, * and can be used to track the progress of the operation, and to cancel it. - * The {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. - * The {@link google.longrunning.Operation.response|response} type - * is {@link google.spanner.admin.database.v1.Database|Database}, if + * The {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} type + * is {@link protos.google.spanner.admin.database.v1.Database|Database}, if * successful. Cancelling the returned operation will stop the restore and * delete the database. * There can be only one database being restored into an instance at a time. @@ -2239,7 +2219,7 @@ export class DatabaseAdminClient { * resources in Cloud KMS used to encrypt/decrypt the database to restore to. * If this field is not specified, the restored database will use * the same encryption configuration as the backup by default, namely - * {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} = + * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} = * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -2247,8 +2227,7 @@ export class DatabaseAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ restoreDatabase( @@ -2341,8 +2320,7 @@ export class DatabaseAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkRestoreDatabaseProgress( @@ -2381,19 +2359,18 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. * @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 google.spanner.admin.database.v1.Database | Database}. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Database|Database}. * 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 `listDatabasesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabases( @@ -2483,18 +2460,17 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. * @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 google.spanner.admin.database.v1.Database | Database} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Database|Database} 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 `listDatabasesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabasesStream( @@ -2533,17 +2509,16 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.admin.database.v1.Database | Database}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.admin.database.v1.Database|Database}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabasesAsync( @@ -2586,7 +2561,7 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: + * The following fields in the {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: * * * `name` * * `database` @@ -2618,20 +2593,19 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same * `filter`. * @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 google.spanner.admin.database.v1.Backup | Backup}. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.Backup|Backup}. * 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 `listBackupsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackups( @@ -2725,7 +2699,7 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: + * The following fields in the {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: * * * `name` * * `database` @@ -2757,19 +2731,18 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same * `filter`. * @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 google.spanner.admin.database.v1.Backup | Backup} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup} 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 `listBackupsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackupsStream( @@ -2812,7 +2785,7 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: + * The following fields in the {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering: * * * `name` * * `database` @@ -2844,18 +2817,17 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same + * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same * `filter`. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.admin.database.v1.Backup | Backup}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackupsAsync( @@ -2880,11 +2852,11 @@ export class DatabaseAdminClient { ) as AsyncIterable; } /** - * Lists database {@link google.longrunning.Operation|longrunning-operations}. + * Lists database {@link protos.google.longrunning.Operation|longrunning-operations}. * A database operation has a name of the form * `projects//instances//databases//operations/`. * The long-running operation - * {@link google.longrunning.Operation.metadata|metadata} field type + * {@link protos.google.longrunning.Operation.metadata|metadata} field type * `metadata.type_url` describes the type of the metadata. Operations returned * include those that have completed/failed/canceled within the last 7 days, * and pending operations. @@ -2903,13 +2875,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is + * for {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -2931,7 +2903,7 @@ export class DatabaseAdminClient { * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -2942,20 +2914,19 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the * same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation}. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. * 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 `listDatabaseOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseOperations( @@ -3053,13 +3024,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is + * for {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -3081,7 +3052,7 @@ export class DatabaseAdminClient { * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -3092,19 +3063,18 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the * same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation} on 'data' event. + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} 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 `listDatabaseOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseOperationsStream( @@ -3147,13 +3117,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is + * for {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first, if filtering on metadata @@ -3175,7 +3145,7 @@ export class DatabaseAdminClient { * `(metadata.name:restored_howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. * * The database is restored from a backup. * * The backup name contains "backup_howl". * * The restored database's name contains "restored_howl". @@ -3186,18 +3156,17 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the * same `parent` and with the same `filter`. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.longrunning.Operation | Operation}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.longrunning.Operation|Operation}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseOperationsAsync( @@ -3222,11 +3191,11 @@ export class DatabaseAdminClient { ) as AsyncIterable; } /** - * Lists the backup {@link google.longrunning.Operation|long-running operations} in + * Lists the backup {@link protos.google.longrunning.Operation|long-running operations} in * the given instance. A backup operation has a name of the form * `projects//instances//backups//operations/`. * The long-running operation - * {@link google.longrunning.Operation.metadata|metadata} field type + * {@link protos.google.longrunning.Operation.metadata|metadata} field type * `metadata.type_url` describes the type of the metadata. Operations returned * include those that have completed/failed/canceled within the last 7 days, * and pending operations. Operations returned are ordered by @@ -3247,13 +3216,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|operation} + * The following fields in the {@link protos.google.longrunning.Operation|operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is + * for {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -3271,14 +3240,14 @@ export class DatabaseAdminClient { * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The database the backup was taken from has a name containing the * string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -3286,7 +3255,7 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. * * The source backup of the copied backup name contains the string * "test". * * The operation started before 2022-01-18T14:50:00Z. @@ -3298,10 +3267,10 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the * database the backup was taken from has name containing string * "test_db" - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the * backup the backup was copied from has name containing string * "test_bkp" * * The operation resulted in an error. @@ -3310,20 +3279,19 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the * same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation}. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. * 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 `listBackupOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackupOperations( @@ -3417,13 +3385,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|operation} + * The following fields in the {@link protos.google.longrunning.Operation|operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is + * for {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -3441,14 +3409,14 @@ export class DatabaseAdminClient { * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The database the backup was taken from has a name containing the * string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -3456,7 +3424,7 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. * * The source backup of the copied backup name contains the string * "test". * * The operation started before 2022-01-18T14:50:00Z. @@ -3468,10 +3436,10 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the * database the backup was taken from has name containing string * "test_db" - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the * backup the backup was copied from has name containing string * "test_bkp" * * The operation resulted in an error. @@ -3480,19 +3448,18 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the * same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation} on 'data' event. + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} 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 `listBackupOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackupOperationsStream( @@ -3535,13 +3502,13 @@ export class DatabaseAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|operation} + * The following fields in the {@link protos.google.longrunning.Operation|operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string - * for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is + * for {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. * * `metadata.` - any field in metadata.value. * `metadata.@type` must be specified first if filtering on metadata @@ -3559,14 +3526,14 @@ export class DatabaseAdminClient { * * `done:true` - The operation is complete. * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `metadata.database:prod` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The database the backup was taken from has a name containing the * string "prod". * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ * `(metadata.name:howl) AND` \ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. * * The backup name contains the string "howl". * * The operation started before 2018-03-28T14:50:00Z. * * The operation resulted in an error. @@ -3574,7 +3541,7 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test) AND` \ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ * `(error:*)` - Returns operations where: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}. * * The source backup of the copied backup name contains the string * "test". * * The operation started before 2022-01-18T14:50:00Z. @@ -3586,10 +3553,10 @@ export class DatabaseAdminClient { * `(metadata.source_backup:test_bkp)) AND` \ * `(error:*)` - Returns operations where: * * The operation's metadata matches either of criteria: - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the * database the backup was taken from has name containing string * "test_db" - * * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the + * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the * backup the backup was copied from has name containing string * "test_bkp" * * The operation resulted in an error. @@ -3598,18 +3565,17 @@ export class DatabaseAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} - * from a previous {@link google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the + * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token} + * from a previous {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the * same `parent` and with the same `filter`. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.longrunning.Operation | Operation}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.longrunning.Operation|Operation}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listBackupOperationsAsync( @@ -3647,19 +3613,18 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. * @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 google.spanner.admin.database.v1.DatabaseRole | DatabaseRole}. + * The first element of the array is Array of {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. * 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 `listDatabaseRolesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseRoles( @@ -3750,18 +3715,17 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. * @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 google.spanner.admin.database.v1.DatabaseRole | DatabaseRole} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole} 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 `listDatabaseRolesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseRolesStream( @@ -3801,17 +3765,16 @@ export class DatabaseAdminClient { * defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a - * previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. + * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a + * previous {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.admin.database.v1.DatabaseRole | DatabaseRole}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listDatabaseRolesAsync( diff --git a/src/v1/instance_admin_client.ts b/src/v1/instance_admin_client.ts index 656d4246d..966a4630a 100644 --- a/src/v1/instance_admin_client.ts +++ b/src/v1/instance_admin_client.ts @@ -113,8 +113,7 @@ export class InstanceAdminClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @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 @@ -122,7 +121,7 @@ export class InstanceAdminClient { * 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 InstanceAdminClient({fallback: 'rest'}, gax); + * const client = new InstanceAdminClient({fallback: true}, gax); * ``` */ constructor( @@ -188,7 +187,7 @@ export class InstanceAdminClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -241,7 +240,7 @@ export class InstanceAdminClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { @@ -489,9 +488,8 @@ export class InstanceAdminClient { * @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 google.spanner.admin.instance.v1.InstanceConfig | InstanceConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getInstanceConfig( @@ -582,7 +580,7 @@ export class InstanceAdminClient { * Only user managed configurations can be deleted. * * Authorization requires `spanner.instanceConfigs.delete` permission on - * the resource {@link google.spanner.admin.instance.v1.InstanceConfig.name|name}. + * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. * * @param {Object} request * The request object that will be sent. @@ -604,9 +602,8 @@ export class InstanceAdminClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ deleteInstanceConfig( @@ -699,15 +696,14 @@ export class InstanceAdminClient { * `projects//instances/`. * @param {google.protobuf.FieldMask} request.fieldMask * If field_mask is present, specifies the subset of - * {@link google.spanner.admin.instance.v1.Instance|Instance} fields that should be + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields that should be * returned. If absent, all - * {@link google.spanner.admin.instance.v1.Instance|Instance} fields are returned. + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} fields 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 google.spanner.admin.instance.v1.Instance | Instance}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getInstance( @@ -805,9 +801,8 @@ export class InstanceAdminClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ deleteInstance( @@ -895,7 +890,7 @@ export class InstanceAdminClient { * existing policy. * * Authorization requires `spanner.instances.setIamPolicy` on - * {@link google.iam.v1.SetIamPolicyRequest.resource|resource}. + * {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}. * * @param {Object} request * The request object that will be sent. @@ -916,9 +911,8 @@ export class InstanceAdminClient { * @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 google.iam.v1.Policy | Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ setIamPolicy( @@ -992,7 +986,7 @@ export class InstanceAdminClient { * policy if an instance exists but does not have a policy set. * * Authorization requires `spanner.instances.getIamPolicy` on - * {@link google.iam.v1.GetIamPolicyRequest.resource|resource}. + * {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}. * * @param {Object} request * The request object that will be sent. @@ -1005,9 +999,8 @@ export class InstanceAdminClient { * @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 google.iam.v1.Policy | Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getIamPolicy( @@ -1097,9 +1090,8 @@ export class InstanceAdminClient { * @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 google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ testIamPermissions( @@ -1171,7 +1163,7 @@ export class InstanceAdminClient { /** * Creates an instance config and begins preparing it to be used. The - * returned {@link google.longrunning.Operation|long-running operation} + * returned {@link protos.google.longrunning.Operation|long-running operation} * can be used to track the progress of preparing the new * instance config. The instance config name is assigned by the caller. If the * named instance config already exists, `CreateInstanceConfig` returns @@ -1181,7 +1173,7 @@ export class InstanceAdminClient { * * * The instance config is readable via the API, with all requested * attributes. The instance config's - * {@link google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} * field is set to true. Its state is `CREATING`. * * While the operation is pending: @@ -1195,22 +1187,22 @@ export class InstanceAdminClient { * * * Instances can be created using the instance configuration. * * The instance config's - * {@link google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} * field becomes false. Its state becomes `READY`. * - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format * `/operations/` and can be used to track * creation of the instance config. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if * successful. * * Authorization requires `spanner.instanceConfigs.create` permission on * the resource - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent|parent}. + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent|parent}. * * @param {Object} request * The request object that will be sent. @@ -1237,8 +1229,7 @@ export class InstanceAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ createInstanceConfig( @@ -1331,8 +1322,7 @@ export class InstanceAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkCreateInstanceConfigProgress( @@ -1360,7 +1350,7 @@ export class InstanceAdminClient { } /** * Updates an instance config. The returned - * {@link google.longrunning.Operation|long-running operation} can be used to track + * {@link protos.google.longrunning.Operation|long-running operation} can be used to track * the progress of updating the instance. If the named instance config does * not exist, returns `NOT_FOUND`. * @@ -1369,13 +1359,13 @@ export class InstanceAdminClient { * Immediately after the request returns: * * * The instance config's - * {@link google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} * field is set to true. * * While the operation is pending: * * * Cancelling the operation sets its metadata's - * {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time|cancel_time}. + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time|cancel_time}. * The operation is guaranteed to succeed at undoing all changes, after * which point it terminates with a `CANCELLED` status. * * All other attempts to modify the instance config are rejected. @@ -1388,36 +1378,36 @@ export class InstanceAdminClient { * values. * * The instance config's new values are readable via the API. * * The instance config's - * {@link google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling} * field becomes false. * - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format * `/operations/` and can be used to track * the instance config modification. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata|UpdateInstanceConfigMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata|UpdateInstanceConfigMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}, if * successful. * * Authorization requires `spanner.instanceConfigs.update` permission on - * the resource {@link google.spanner.admin.instance.v1.InstanceConfig.name|name}. + * the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}. * * @param {Object} request * The request object that will be sent. * @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig * Required. The user instance config to update, which must always include the * instance config name. Otherwise, only fields mentioned in - * {@link google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask|update_mask} + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask|update_mask} * need be included. To prevent conflicts of concurrent updates, - * {@link google.spanner.admin.instance.v1.InstanceConfig.reconciling|etag} can + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|etag} can * be used. * @param {google.protobuf.FieldMask} request.updateMask * Required. A mask specifying which fields in - * {@link google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} should be + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} should be * updated. The field mask must always be specified; this prevents any future - * fields in {@link google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} + * fields in {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} * from being erased accidentally by clients that do not know about them. Only * display_name and labels can be updated. * @param {boolean} request.validateOnly @@ -1429,8 +1419,7 @@ export class InstanceAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ updateInstanceConfig( @@ -1523,8 +1512,7 @@ export class InstanceAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkUpdateInstanceConfigProgress( @@ -1552,7 +1540,7 @@ export class InstanceAdminClient { } /** * Creates an instance and begins preparing it to begin serving. The - * returned {@link google.longrunning.Operation|long-running operation} + * returned {@link protos.google.longrunning.Operation|long-running operation} * can be used to track the progress of preparing the new * instance. The instance name is assigned by the caller. If the * named instance already exists, `CreateInstance` returns @@ -1578,13 +1566,13 @@ export class InstanceAdminClient { * * The instance's allocated resource levels are readable via the API. * * The instance's state becomes `READY`. * - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format `/operations/` and * can be used to track creation of the instance. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.instance.v1.CreateInstanceMetadata|CreateInstanceMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.instance.v1.Instance|Instance}, if successful. + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceMetadata|CreateInstanceMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. * * @param {Object} request * The request object that will be sent. @@ -1593,7 +1581,7 @@ export class InstanceAdminClient { * are of the form `projects/`. * @param {string} request.instanceId * Required. The ID of the instance to create. Valid identifiers are of the - * form `{@link -a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 characters in + * form `{@link protos.-a-z0-9|a-z}*[a-z0-9]` and must be between 2 and 64 characters in * length. * @param {google.spanner.admin.instance.v1.Instance} request.instance * Required. The instance to create. The name may be omitted, but if @@ -1604,8 +1592,7 @@ export class InstanceAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ createInstance( @@ -1698,8 +1685,7 @@ export class InstanceAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkCreateInstanceProgress( @@ -1740,7 +1726,7 @@ export class InstanceAdminClient { * Until completion of the returned operation: * * * Cancelling the operation sets its metadata's - * {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time|cancel_time}, + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time|cancel_time}, * and begins restoring resources to their pre-request values. The * operation is guaranteed to succeed at undoing all resource changes, * after which point it terminates with a `CANCELLED` status. @@ -1756,29 +1742,29 @@ export class InstanceAdminClient { * tables. * * The instance's new resource levels are readable via the API. * - * The returned {@link google.longrunning.Operation|long-running operation} will + * The returned {@link protos.google.longrunning.Operation|long-running operation} will * have a name of the format `/operations/` and * can be used to track the instance modification. The - * {@link google.longrunning.Operation.metadata|metadata} field type is - * {@link google.spanner.admin.instance.v1.UpdateInstanceMetadata|UpdateInstanceMetadata}. - * The {@link google.longrunning.Operation.response|response} field type is - * {@link google.spanner.admin.instance.v1.Instance|Instance}, if successful. + * {@link protos.google.longrunning.Operation.metadata|metadata} field type is + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata|UpdateInstanceMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} field type is + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}, if successful. * * Authorization requires `spanner.instances.update` permission on - * the resource {@link google.spanner.admin.instance.v1.Instance.name|name}. + * the resource {@link protos.google.spanner.admin.instance.v1.Instance.name|name}. * * @param {Object} request * The request object that will be sent. * @param {google.spanner.admin.instance.v1.Instance} request.instance * Required. The instance to update, which must always include the instance * name. Otherwise, only fields mentioned in - * {@link google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask|field_mask} + * {@link protos.google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask|field_mask} * need be included. * @param {google.protobuf.FieldMask} request.fieldMask * Required. A mask specifying which fields in - * {@link google.spanner.admin.instance.v1.Instance|Instance} should be updated. + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} should be updated. * The field mask must always be specified; this prevents any future fields in - * {@link google.spanner.admin.instance.v1.Instance|Instance} from being erased + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance} from being erased * accidentally by clients that do not know about them. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1786,8 +1772,7 @@ export class InstanceAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ updateInstance( @@ -1880,8 +1865,7 @@ export class InstanceAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. */ async checkUpdateInstanceProgress( @@ -1921,20 +1905,19 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. * @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 google.spanner.admin.instance.v1.InstanceConfig | InstanceConfig}. + * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. * 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 `listInstanceConfigsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigs( @@ -2025,19 +2008,18 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. * @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 google.spanner.admin.instance.v1.InstanceConfig | InstanceConfig} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} 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 `listInstanceConfigsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigsStream( @@ -2077,18 +2059,17 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.admin.instance.v1.InstanceConfig | InstanceConfig}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigsAsync( @@ -2118,7 +2099,7 @@ export class InstanceAdminClient { * config operation has a name of the form * `projects//instanceConfigs//operations/`. * The long-running operation - * {@link google.longrunning.Operation.metadata|metadata} field type + * {@link protos.google.longrunning.Operation.metadata|metadata} field type * `metadata.type_url` describes the type of the metadata. Operations returned * include those that have completed/failed/canceled within the last 7 days, * and pending operations. Operations returned are ordered by @@ -2139,14 +2120,14 @@ export class InstanceAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string * for - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} * is * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. * * `metadata.` - any field in metadata.value. @@ -2170,7 +2151,7 @@ export class InstanceAdminClient { * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: * * The operation's metadata type is - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. * * The instance config name contains "custom-config". * * The operation started before 2021-03-28T14:50:00Z. * * The operation resulted in an error. @@ -2179,21 +2160,20 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} * to the same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation}. + * The first element of the array is Array of {@link protos.google.longrunning.Operation|Operation}. * 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 `listInstanceConfigOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigOperations( @@ -2291,14 +2271,14 @@ export class InstanceAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string * for - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} * is * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. * * `metadata.` - any field in metadata.value. @@ -2322,7 +2302,7 @@ export class InstanceAdminClient { * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: * * The operation's metadata type is - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. * * The instance config name contains "custom-config". * * The operation started before 2021-03-28T14:50:00Z. * * The operation resulted in an error. @@ -2331,20 +2311,19 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} * to the same `parent` and with the same `filter`. * @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 google.longrunning.Operation | Operation} on 'data' event. + * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} 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 `listInstanceConfigOperationsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigOperationsStream( @@ -2387,14 +2366,14 @@ export class InstanceAdminClient { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the {@link google.longrunning.Operation|Operation} + * The following fields in the {@link protos.google.longrunning.Operation|Operation} * are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. * * `metadata.@type` - the type of metadata. For example, the type string * for - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata} * is * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. * * `metadata.` - any field in metadata.value. @@ -2418,7 +2397,7 @@ export class InstanceAdminClient { * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ * `(error:*)` - Return operations where: * * The operation's metadata type is - * {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. + * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}. * * The instance config name contains "custom-config". * * The operation started before 2021-03-28T14:50:00Z. * * The operation resulted in an error. @@ -2427,19 +2406,18 @@ export class InstanceAdminClient { * less, defaults to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} + * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse} * to the same `parent` and with the same `filter`. * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.longrunning.Operation | Operation}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.longrunning.Operation|Operation}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstanceConfigOperationsAsync( @@ -2476,9 +2454,9 @@ export class InstanceAdminClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -2502,14 +2480,13 @@ export class InstanceAdminClient { * @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 google.spanner.admin.instance.v1.Instance | Instance}. + * The first element of the array is Array of {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. * 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 `listInstancesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstances( @@ -2599,9 +2576,9 @@ export class InstanceAdminClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -2625,13 +2602,12 @@ export class InstanceAdminClient { * @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 google.spanner.admin.instance.v1.Instance | Instance} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance} 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 `listInstancesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstancesStream( @@ -2670,9 +2646,9 @@ export class InstanceAdminClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token} * from a previous - * {@link google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. + * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -2696,12 +2672,11 @@ export class InstanceAdminClient { * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.admin.instance.v1.Instance | Instance}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listInstancesAsync( diff --git a/src/v1/spanner_client.ts b/src/v1/spanner_client.ts index 1738412ba..669cecadc 100644 --- a/src/v1/spanner_client.ts +++ b/src/v1/spanner_client.ts @@ -93,8 +93,7 @@ export class SpannerClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @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 @@ -102,7 +101,7 @@ export class SpannerClient { * 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 SpannerClient({fallback: 'rest'}, gax); + * const client = new SpannerClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class SpannerClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -205,11 +204,15 @@ export class SpannerClient { this.descriptors.stream = { executeStreamingSql: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, - opts.fallback === 'rest' + !!opts.fallback ), streamingRead: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, - opts.fallback === 'rest' + !!opts.fallback + ), + batchWrite: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback ), }; @@ -278,6 +281,7 @@ export class SpannerClient { 'rollback', 'partitionQuery', 'partitionRead', + 'batchWrite', ]; for (const methodName of spannerStubMethods) { const callPromise = this.spannerStub.then( @@ -409,9 +413,8 @@ export class SpannerClient { * @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 google.spanner.v1.Session | Session}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ createSession( @@ -497,13 +500,13 @@ export class SpannerClient { * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * {@link google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count} as necessary). + * {@link protos.google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count} + * as necessary). * @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 google.spanner.v1.BatchCreateSessionsResponse | BatchCreateSessionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.BatchCreateSessionsResponse|BatchCreateSessionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ batchCreateSessions( @@ -586,9 +589,8 @@ export class SpannerClient { * @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 google.spanner.v1.Session | Session}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ getSession( @@ -669,9 +671,8 @@ export class SpannerClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ deleteSession( @@ -748,10 +749,12 @@ export class SpannerClient { * * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See {@link google.spanner.v1.Transaction|Transaction} for more details. + * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more + * details. * * Larger result sets can be fetched in streaming fashion by calling - * {@link google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} instead. + * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} + * instead. * * @param {Object} request * The request object that will be sent. @@ -787,23 +790,27 @@ export class SpannerClient { * @param {number[]} request.paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in {@link google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. + * of type `STRING` both appear in + * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the - * definition of {@link google.spanner.v1.Type|Type} for more information + * definition of {@link protos.google.spanner.v1.Type|Type} for more information * about SQL types. * @param {Buffer} request.resumeToken * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * {@link google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode * Used to control the amount of debugging information returned in - * {@link google.spanner.v1.ResultSetStats|ResultSetStats}. If {@link google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is set, {@link google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only - * be set to {@link google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. + * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If + * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is + * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only + * be set to + * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. * @param {Buffer} request.partitionToken * If present, results will be restricted to the specified partition * previously created using PartitionQuery(). There must be an exact @@ -824,18 +831,19 @@ export class SpannerClient { * Query optimizer configuration to use for the given query. * @param {google.spanner.v1.RequestOptions} request.requestOptions * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. * @param {boolean} request.dataBoostEnabled * If this is for a partitioned query and this field is set to `true`, the - * request will be executed via Spanner independent compute resources. + * request is executed with Spanner Data Boost independent compute resources. * * If the field is set to `true` but the request does not set - * `partition_token`, the API will return an `INVALID_ARGUMENT` error. + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. * @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 google.spanner.v1.ResultSet | ResultSet}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ executeSql( @@ -907,12 +915,13 @@ export class SpannerClient { /** * Executes a batch of SQL DML statements. This method allows many statements * to be run with lower latency than submitting them sequentially with - * {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. * * Statements are executed in sequential order. A request can succeed even if - * a statement fails. The {@link google.spanner.v1.ExecuteBatchDmlResponse.status|ExecuteBatchDmlResponse.status} field in the - * response provides information about the statement that failed. Clients must - * inspect this field to determine whether an error occurred. + * a statement fails. The + * {@link protos.google.spanner.v1.ExecuteBatchDmlResponse.status|ExecuteBatchDmlResponse.status} + * field in the response provides information about the statement that failed. + * Clients must inspect this field to determine whether an error occurred. * * Execution stops after the first failed statement; the remaining statements * are not executed. @@ -928,16 +937,16 @@ export class SpannerClient { * caller must either supply an existing transaction ID or begin a new * transaction. * @param {number[]} request.statements - * Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * * Callers must provide at least one statement. * @param {number} request.seqno - * Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order @@ -948,9 +957,8 @@ export class SpannerClient { * @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 google.spanner.v1.ExecuteBatchDmlResponse | ExecuteBatchDmlResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.ExecuteBatchDmlResponse|ExecuteBatchDmlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ executeBatchDml( @@ -1022,17 +1030,18 @@ export class SpannerClient { /** * Reads rows from the database using key lookups and scans, as a * simple key/value style alternative to - * {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method cannot be used to - * return a result set larger than 10 MiB; if the read matches more + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method cannot be + * used to return a result set larger than 10 MiB; if the read matches more * data than that, the read fails with a `FAILED_PRECONDITION` * error. * * Reads inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See {@link google.spanner.v1.Transaction|Transaction} for more details. + * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more + * details. * * Larger result sets can be yielded in streaming fashion by calling - * {@link google.spanner.v1.Spanner.StreamingRead|StreamingRead} instead. + * {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} instead. * * @param {Object} request * The request object that will be sent. @@ -1044,22 +1053,29 @@ export class SpannerClient { * @param {string} request.table * Required. The name of the table in the database to be read. * @param {string} request.index - * If non-empty, the name of an index on {@link google.spanner.v1.ReadRequest.table|table}. This index is - * used instead of the table primary key when interpreting {@link google.spanner.v1.ReadRequest.key_set|key_set} - * and sorting result rows. See {@link google.spanner.v1.ReadRequest.key_set|key_set} for further information. + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of + * the table primary key when interpreting + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. + * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further + * information. * @param {string[]} request.columns - * Required. The columns of {@link google.spanner.v1.ReadRequest.table|table} to be returned for each row matching - * this request. + * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be + * returned for each row matching this request. * @param {google.spanner.v1.KeySet} request.keySet * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in {@link google.spanner.v1.ReadRequest.table|table} to be yielded, unless {@link google.spanner.v1.ReadRequest.index|index} - * is present. If {@link google.spanner.v1.ReadRequest.index|index} is present, then {@link google.spanner.v1.ReadRequest.key_set|key_set} instead names - * index keys in {@link google.spanner.v1.ReadRequest.index|index}. - * - * If the {@link google.spanner.v1.ReadRequest.partition_token|partition_token} field is empty, rows are yielded - * in table primary key order (if {@link google.spanner.v1.ReadRequest.index|index} is empty) or index key order - * (if {@link google.spanner.v1.ReadRequest.index|index} is non-empty). If the {@link google.spanner.v1.ReadRequest.partition_token|partition_token} field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to + * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. + * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys + * in {@link protos.google.spanner.v1.ReadRequest.index|index}. + * + * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} + * field is empty, rows are yielded in table primary key order (if + * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order + * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the + * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field is + * not empty, rows will be yielded in an unspecified order. * * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -1070,9 +1086,9 @@ export class SpannerClient { * @param {Buffer} request.resumeToken * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * {@link google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * @param {Buffer} request.partitionToken * If present, results will be restricted to the specified partition @@ -1081,18 +1097,19 @@ export class SpannerClient { * PartitionReadRequest message used to create this partition_token. * @param {google.spanner.v1.RequestOptions} request.requestOptions * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. * @param {boolean} request.dataBoostEnabled * If this is for a partitioned read and this field is set to `true`, the - * request will be executed via Spanner independent compute resources. + * request is executed with Spanner Data Boost independent compute resources. * * If the field is set to `true` but the request does not set - * `partition_token`, the API will return an `INVALID_ARGUMENT` error. + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. * @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 google.spanner.v1.ResultSet | ResultSet}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ read( @@ -1163,8 +1180,9 @@ export class SpannerClient { } /** * Begins a new transaction. This step can often be skipped: - * {@link google.spanner.v1.Spanner.Read|Read}, {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} and - * {@link google.spanner.v1.Spanner.Commit|Commit} can begin a new transaction as a + * {@link protos.google.spanner.v1.Spanner.Read|Read}, + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} and + * {@link protos.google.spanner.v1.Spanner.Commit|Commit} can begin a new transaction as a * side-effect. * * @param {Object} request @@ -1182,9 +1200,8 @@ export class SpannerClient { * @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 google.spanner.v1.Transaction | Transaction}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.Transaction|Transaction}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ beginTransaction( @@ -1283,24 +1300,23 @@ export class SpannerClient { * instance, due to retries in the application, or in the * transport library), it is possible that the mutations are * executed more than once. If this is undesirable, use - * {@link google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and - * {@link google.spanner.v1.Spanner.Commit|Commit} instead. + * {@link protos.google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and + * {@link protos.google.spanner.v1.Spanner.Commit|Commit} instead. * @param {number[]} request.mutations * The mutations to be executed when this transaction commits. All * mutations are applied atomically, in the order they appear in * this list. * @param {boolean} request.returnCommitStats * If `true`, then statistics related to the transaction will be included in - * the {@link google.spanner.v1.CommitResponse.commit_stats|CommitResponse}. Default value is - * `false`. + * the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}. + * Default value is `false`. * @param {google.spanner.v1.RequestOptions} request.requestOptions * Common options for this request. * @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 google.spanner.v1.CommitResponse | CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.CommitResponse|CommitResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ commit( @@ -1372,8 +1388,9 @@ export class SpannerClient { /** * Rolls back a transaction, releasing any locks it holds. It is a good * idea to call this for any transaction that includes one or more - * {@link google.spanner.v1.Spanner.Read|Read} or {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and - * ultimately decides not to commit. + * {@link protos.google.spanner.v1.Spanner.Read|Read} or + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and ultimately + * decides not to commit. * * `Rollback` returns `OK` if it successfully aborts the transaction, the * transaction was already aborted, or the transaction is not @@ -1388,9 +1405,8 @@ export class SpannerClient { * @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 google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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. */ rollback( @@ -1462,10 +1478,11 @@ export class SpannerClient { /** * Creates a set of partition tokens that can be used to execute a query * operation in parallel. Each of the returned partition tokens can be used - * by {@link google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to specify a subset - * of the query result to read. The same session and read-only transaction - * must be used by the PartitionQueryRequest used to create the - * partition tokens and the ExecuteSqlRequests that use the partition tokens. + * by {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to + * specify a subset of the query result to read. The same session and + * read-only transaction must be used by the PartitionQueryRequest used to + * create the partition tokens and the ExecuteSqlRequests that use the + * partition tokens. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too @@ -1480,15 +1497,16 @@ export class SpannerClient { * Read only snapshot transactions are supported, read/write and single use * transactions are not. * @param {string} request.sql - * Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root - * partitionable query has a single distributed union operator. A distributed - * union operator conceptually divides one or more tables into multiple - * splits, remotely evaluates a subquery independently on each split, and - * then unions all results. - * - * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use {@link google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} with a + * Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. For a query to be root + * partitionable, it needs to satisfy a few conditions. For example, the first + * operator in the query execution plan must be a distributed union operator. + * For more information about other conditions, see [Read data in + * parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + * + * The query request must not contain DML commands, such as INSERT, UPDATE, or + * DELETE. Use + * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} with a * PartitionedDml transaction for large, partition-friendly DML operations. * @param {google.protobuf.Struct} request.params * Parameter names and values that bind to placeholders in the SQL string. @@ -1506,20 +1524,20 @@ export class SpannerClient { * @param {number[]} request.paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in {@link google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings. + * of type `STRING` both appear in + * {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the - * definition of {@link google.spanner.v1.Type|Type} for more information + * definition of {@link protos.google.spanner.v1.Type|Type} for more information * about SQL types. * @param {google.spanner.v1.PartitionOptions} request.partitionOptions * Additional options that affect how many partitions are created. * @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 google.spanner.v1.PartitionResponse | PartitionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ partitionQuery( @@ -1591,12 +1609,13 @@ export class SpannerClient { /** * Creates a set of partition tokens that can be used to execute a read * operation in parallel. Each of the returned partition tokens can be used - * by {@link google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a subset of the read - * result to read. The same session and read-only transaction must be used by - * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. There are no ordering - * guarantees on rows returned among the returned partition tokens, or even - * within each individual StreamingRead call issued with a partition_token. + * by {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a + * subset of the read result to read. The same session and read-only + * transaction must be used by the PartitionReadRequest used to create the + * partition tokens and the ReadRequests that use the partition tokens. There + * are no ordering guarantees on rows returned among the returned partition + * tokens, or even within each individual StreamingRead call issued with a + * partition_token. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too @@ -1613,17 +1632,23 @@ export class SpannerClient { * @param {string} request.table * Required. The name of the table in the database to be read. * @param {string} request.index - * If non-empty, the name of an index on {@link google.spanner.v1.PartitionReadRequest.table|table}. This index is - * used instead of the table primary key when interpreting {@link google.spanner.v1.PartitionReadRequest.key_set|key_set} - * and sorting result rows. See {@link google.spanner.v1.PartitionReadRequest.key_set|key_set} for further information. + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.PartitionReadRequest.table|table}. This index is used + * instead of the table primary key when interpreting + * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} and sorting + * result rows. See {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} + * for further information. * @param {string[]} request.columns - * The columns of {@link google.spanner.v1.PartitionReadRequest.table|table} to be returned for each row matching - * this request. + * The columns of {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be + * returned for each row matching this request. * @param {google.spanner.v1.KeySet} request.keySet * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in {@link google.spanner.v1.PartitionReadRequest.table|table} to be yielded, unless {@link google.spanner.v1.PartitionReadRequest.index|index} - * is present. If {@link google.spanner.v1.PartitionReadRequest.index|index} is present, then {@link google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names - * index keys in {@link google.spanner.v1.PartitionReadRequest.index|index}. + * primary keys of the rows in + * {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be yielded, unless + * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present. If + * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names + * index keys in {@link protos.google.spanner.v1.PartitionReadRequest.index|index}. * * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -1632,9 +1657,8 @@ export class SpannerClient { * @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 google.spanner.v1.PartitionResponse | PartitionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. */ partitionRead( @@ -1705,11 +1729,11 @@ export class SpannerClient { } /** - * Like {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, except returns the result - * set as a stream. Unlike {@link google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, there - * is no limit on the size of the returned result set. However, no - * individual row in the result set can exceed 100 MiB, and no - * column value can exceed 10 MiB. + * Like {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, except returns the + * result set as a stream. Unlike + * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, there is no limit on + * the size of the returned result set. However, no individual row in the + * result set can exceed 100 MiB, and no column value can exceed 10 MiB. * * @param {Object} request * The request object that will be sent. @@ -1745,23 +1769,27 @@ export class SpannerClient { * @param {number[]} request.paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in {@link google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. + * of type `STRING` both appear in + * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the - * definition of {@link google.spanner.v1.Type|Type} for more information + * definition of {@link protos.google.spanner.v1.Type|Type} for more information * about SQL types. * @param {Buffer} request.resumeToken * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * {@link google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode * Used to control the amount of debugging information returned in - * {@link google.spanner.v1.ResultSetStats|ResultSetStats}. If {@link google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is set, {@link google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only - * be set to {@link google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. + * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If + * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is + * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only + * be set to + * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}. * @param {Buffer} request.partitionToken * If present, results will be restricted to the specified partition * previously created using PartitionQuery(). There must be an exact @@ -1782,18 +1810,19 @@ export class SpannerClient { * Query optimizer configuration to use for the given query. * @param {google.spanner.v1.RequestOptions} request.requestOptions * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. * @param {boolean} request.dataBoostEnabled * If this is for a partitioned query and this field is set to `true`, the - * request will be executed via Spanner independent compute resources. + * request is executed with Spanner Data Boost independent compute resources. * * If the field is set to `true` but the request does not set - * `partition_token`, the API will return an `INVALID_ARGUMENT` error. + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. * @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 {@link google.spanner.v1.PartialResultSet | PartialResultSet} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } * for more details and examples. */ executeStreamingSql( @@ -1813,9 +1842,9 @@ export class SpannerClient { } /** - * Like {@link google.spanner.v1.Spanner.Read|Read}, except returns the result set as a - * stream. Unlike {@link google.spanner.v1.Spanner.Read|Read}, there is no limit on the - * size of the returned result set. However, no individual row in + * Like {@link protos.google.spanner.v1.Spanner.Read|Read}, except returns the result set + * as a stream. Unlike {@link protos.google.spanner.v1.Spanner.Read|Read}, there is no + * limit on the size of the returned result set. However, no individual row in * the result set can exceed 100 MiB, and no column value can exceed * 10 MiB. * @@ -1829,22 +1858,29 @@ export class SpannerClient { * @param {string} request.table * Required. The name of the table in the database to be read. * @param {string} request.index - * If non-empty, the name of an index on {@link google.spanner.v1.ReadRequest.table|table}. This index is - * used instead of the table primary key when interpreting {@link google.spanner.v1.ReadRequest.key_set|key_set} - * and sorting result rows. See {@link google.spanner.v1.ReadRequest.key_set|key_set} for further information. + * If non-empty, the name of an index on + * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of + * the table primary key when interpreting + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows. + * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further + * information. * @param {string[]} request.columns - * Required. The columns of {@link google.spanner.v1.ReadRequest.table|table} to be returned for each row matching - * this request. + * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be + * returned for each row matching this request. * @param {google.spanner.v1.KeySet} request.keySet * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in {@link google.spanner.v1.ReadRequest.table|table} to be yielded, unless {@link google.spanner.v1.ReadRequest.index|index} - * is present. If {@link google.spanner.v1.ReadRequest.index|index} is present, then {@link google.spanner.v1.ReadRequest.key_set|key_set} instead names - * index keys in {@link google.spanner.v1.ReadRequest.index|index}. - * - * If the {@link google.spanner.v1.ReadRequest.partition_token|partition_token} field is empty, rows are yielded - * in table primary key order (if {@link google.spanner.v1.ReadRequest.index|index} is empty) or index key order - * (if {@link google.spanner.v1.ReadRequest.index|index} is non-empty). If the {@link google.spanner.v1.ReadRequest.partition_token|partition_token} field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to + * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present. + * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then + * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys + * in {@link protos.google.spanner.v1.ReadRequest.index|index}. + * + * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} + * field is empty, rows are yielded in table primary key order (if + * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order + * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the + * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field is + * not empty, rows will be yielded in an unspecified order. * * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -1855,9 +1891,9 @@ export class SpannerClient { * @param {Buffer} request.resumeToken * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * {@link google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * @param {Buffer} request.partitionToken * If present, results will be restricted to the specified partition @@ -1866,18 +1902,19 @@ export class SpannerClient { * PartitionReadRequest message used to create this partition_token. * @param {google.spanner.v1.RequestOptions} request.requestOptions * Common options for this request. + * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions + * Directed read options for this request. * @param {boolean} request.dataBoostEnabled * If this is for a partitioned read and this field is set to `true`, the - * request will be executed via Spanner independent compute resources. + * request is executed with Spanner Data Boost independent compute resources. * * If the field is set to `true` but the request does not set - * `partition_token`, the API will return an `INVALID_ARGUMENT` error. + * `partition_token`, the API returns an `INVALID_ARGUMENT` error. * @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 {@link google.spanner.v1.PartialResultSet | PartialResultSet} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } * for more details and examples. */ streamingRead( @@ -1896,6 +1933,54 @@ export class SpannerClient { return this.innerApiCalls.streamingRead(request, options); } + /** + * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.session + * Required. The session in which the batch request is to be run. + * @param {google.spanner.v1.RequestOptions} request.requestOptions + * Common options for this request. + * @param {number[]} request.mutationGroups + * Required. The groups of mutations to be applied. + * @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 {@link protos.google.spanner.v1.BatchWriteResponse|BatchWriteResponse} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + */ + batchWrite( + request?: protos.google.spanner.v1.IBatchWriteRequest, + options?: CallOptions + ): gax.CancellableStream { + 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({ + session: request.session ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchWrite(request, options); + } + /** * Lists all sessions in a given database. * @@ -1908,8 +1993,9 @@ export class SpannerClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} from a previous - * {@link google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -1924,14 +2010,13 @@ export class SpannerClient { * @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 google.spanner.v1.Session | Session}. + * The first element of the array is Array of {@link protos.google.spanner.v1.Session|Session}. * 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 `listSessionsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listSessions( @@ -2012,8 +2097,9 @@ export class SpannerClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} from a previous - * {@link google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -2028,13 +2114,12 @@ export class SpannerClient { * @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 google.spanner.v1.Session | Session} on 'data' event. + * An object stream which emits an object representing {@link protos.google.spanner.v1.Session|Session} 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 `listSessionsAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listSessionsStream( @@ -2072,8 +2157,9 @@ export class SpannerClient { * to the server's maximum allowed page size. * @param {string} request.pageToken * If non-empty, `page_token` should contain a - * {@link google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} from a previous - * {@link google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. + * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token} + * from a previous + * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}. * @param {string} request.filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -2088,12 +2174,11 @@ export class SpannerClient { * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * 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 google.spanner.v1.Session | Session}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.spanner.v1.Session|Session}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listSessionsAsync( diff --git a/src/v1/spanner_client_config.json b/src/v1/spanner_client_config.json index d14bef0e6..f1ed7096b 100644 --- a/src/v1/spanner_client_config.json +++ b/src/v1/spanner_client_config.json @@ -106,6 +106,11 @@ "timeout_millis": 30000, "retry_codes_name": "unavailable", "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "BatchWrite": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/system-test/spanner.ts b/system-test/spanner.ts index ddacbf344..fa5878f04 100644 --- a/system-test/spanner.ts +++ b/system-test/spanner.ts @@ -158,9 +158,8 @@ describe('Spanner', () => { PRIMARY KEY (SingerId) );`, ]; - const [postgreSqlOperationUpdateDDL] = await pg_database.updateSchema( - schema - ); + const [postgreSqlOperationUpdateDDL] = + await pg_database.updateSchema(schema); await postgreSqlOperationUpdateDDL.promise(); RESOURCES_TO_CLEAN.push(PG_DATABASE); @@ -2617,9 +2616,8 @@ describe('Spanner', () => { ); await operation.promise(); - const [operationUpdateDDL] = await database.updateSchema( - database_schema - ); + const [operationUpdateDDL] = + await database.updateSchema(database_schema); await operationUpdateDDL.promise(); const [schema] = await database.getSchema(); diff --git a/test/gapic_spanner_v1.ts b/test/gapic_spanner_v1.ts index d1974d5cd..a545b3660 100644 --- a/test/gapic_spanner_v1.ts +++ b/test/gapic_spanner_v1.ts @@ -1898,7 +1898,9 @@ describe('v1.SpannerClient', () => { request.session = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - const stream = client.executeStreamingSql(request); + const stream = client.executeStreamingSql(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); const promise = new Promise((resolve, reject) => { stream.on( 'data', @@ -2018,7 +2020,9 @@ describe('v1.SpannerClient', () => { request.session = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - const stream = client.streamingRead(request); + const stream = client.streamingRead(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); const promise = new Promise((resolve, reject) => { stream.on( 'data', @@ -2034,6 +2038,128 @@ describe('v1.SpannerClient', () => { }); }); + describe('batchWrite', () => { + it('invokes batchWrite without error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.spanner.v1.BatchWriteRequest', + ['session'] + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteResponse() + ); + client.innerApiCalls.batchWrite = + stubServerStreamingCall(expectedResponse); + const stream = client.batchWrite(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchWrite as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchWrite as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchWrite with error', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.spanner.v1.BatchWriteRequest', + ['session'] + ); + request.session = defaultValue1; + const expectedHeaderRequestParams = `session=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchWrite = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.batchWrite(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.batchWrite as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchWrite as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchWrite with closed client', async () => { + const client = new spannerModule.v1.SpannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.spanner.v1.BatchWriteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.spanner.v1.BatchWriteRequest', + ['session'] + ); + request.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.batchWrite(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.spanner.v1.BatchWriteResponse) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); + describe('listSessions', () => { it('invokes listSessions without error', async () => { const client = new spannerModule.v1.SpannerClient({ diff --git a/test/session-pool.ts b/test/session-pool.ts index 65d123b4d..43599585d 100644 --- a/test/session-pool.ts +++ b/test/session-pool.ts @@ -84,6 +84,7 @@ describe('SessionPool', () => { getColumnNumber: sandbox.stub().returns('13'), getTypeName: sandbox.stub().returns('type'), isNative: sandbox.stub().returns(false), + isConstructor: sandbox.stub().returns(false), }; }; diff --git a/test/spanner.ts b/test/spanner.ts index a01338ac5..87e1493c9 100644 --- a/test/spanner.ts +++ b/test/spanner.ts @@ -4254,9 +4254,8 @@ describe('Spanner with mock server', () => { const dbSpecificQuery: GetDatabaseOperationsOptions = { filter: dbSpecificFilter, }; - const [operations1] = await instance.getDatabaseOperations( - dbSpecificQuery - ); + const [operations1] = + await instance.getDatabaseOperations(dbSpecificQuery); const database = instance.database('test-database'); const [operations2] = await database.getOperations();