From 0ee98319f291f552a0afc52629d12af9969d1d10 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 29 Mar 2024 23:07:48 +0100 Subject: [PATCH 1/4] fix(deps): update dependency google-gax to v4.3.2 (#2026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): update dependency google-gax to v4.3.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- package.json | 2 +- protos/protos.d.ts | 9 ++++++++ protos/protos.js | 53 +++++++++++++++++++++++++++++++++++++++++----- protos/protos.json | 26 ++++++++++++++++++++++- 4 files changed, 83 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index caf64b642..89b2ebce8 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "events-intercept": "^2.0.0", "extend": "^3.0.2", "google-auth-library": "^9.0.0", - "google-gax": "4.3.1", + "google-gax": "4.3.2", "grpc-gcp": "^1.0.0", "is": "^3.2.1", "lodash.snakecase": "^4.1.1", diff --git a/protos/protos.d.ts b/protos/protos.d.ts index c8a75f39b..074ba8102 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -2917,6 +2917,9 @@ export namespace google { /** ServiceOptions .google.api.oauthScopes */ ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); } /** Represents a ServiceOptions. */ @@ -32818,6 +32821,9 @@ export namespace google { /** Publishing protoReferenceDocumentationUri */ protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); } /** Represents a Publishing. */ @@ -32859,6 +32865,9 @@ export namespace google { /** Publishing protoReferenceDocumentationUri. */ public protoReferenceDocumentationUri: string; + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + /** * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index e0658539d..67e64d3a6 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -6645,12 +6645,9 @@ 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(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; @@ -8496,6 +8493,7 @@ * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion */ /** @@ -8554,6 +8552,14 @@ */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + /** * Creates a new ServiceOptions instance using the specified properties. * @function create @@ -8589,6 +8595,8 @@ writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); return writer; }; @@ -8645,6 +8653,10 @@ message[".google.api.oauthScopes"] = reader.string(); break; } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8703,6 +8715,9 @@ if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; return null; }; @@ -8739,6 +8754,8 @@ message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); return message; }; @@ -8762,6 +8779,7 @@ object.features = null; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -8776,6 +8794,8 @@ object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; return object; }; @@ -84259,6 +84279,7 @@ * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization * @property {Array.|null} [librarySettings] Publishing librarySettings * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri */ /** @@ -84359,6 +84380,14 @@ */ Publishing.prototype.protoReferenceDocumentationUri = ""; + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + /** * Creates a new Publishing instance using the specified properties. * @function create @@ -84406,6 +84435,8 @@ $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); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); return writer; }; @@ -84486,6 +84517,10 @@ message.protoReferenceDocumentationUri = reader.string(); break; } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -84578,6 +84613,9 @@ if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) if (!$util.isString(message.protoReferenceDocumentationUri)) return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; return null; }; @@ -84672,6 +84710,8 @@ } if (object.protoReferenceDocumentationUri != null) message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); return message; }; @@ -84701,6 +84741,7 @@ object.docTagPrefix = ""; object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; } if (message.methodSettings && message.methodSettings.length) { object.methodSettings = []; @@ -84731,6 +84772,8 @@ } if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; return object; }; diff --git a/protos/protos.json b/protos/protos.json index ecb626043..caed224f6 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1118,9 +1118,21 @@ 1001, 1001 ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], [ 9995, 9999 + ], + [ + 10000, + 10000 ] ], "reserved": [ @@ -8367,7 +8379,10 @@ "rule": "repeated", "type": "google.api.FieldBehavior", "id": 1052, - "extend": "google.protobuf.FieldOptions" + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } }, "FieldBehavior": { "values": { @@ -8562,6 +8577,11 @@ "id": 1050, "extend": "google.protobuf.ServiceOptions" }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, "CommonLanguageSettings": { "fields": { "referenceDocsUri": { @@ -8670,6 +8690,10 @@ "protoReferenceDocumentationUri": { "type": "string", "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 } } }, From 5292e035c5278ba6806f9e1eb84809ed893b1e37 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:49:31 -0400 Subject: [PATCH 2/4] feat(spanner): adding `EXPECTED_FULFILLMENT_PERIOD` to the indicate instance creation times (with `FULFILLMENT_PERIOD_NORMAL` or `FULFILLMENT_PERIOD_EXTENDED` ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature (#2024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add several fields to manage state of database encryption update PiperOrigin-RevId: 619289281 Source-Link: https://github.com/googleapis/googleapis/commit/3a7c33486ca758b180c6d11dd4705fa9a22e8576 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6a8c733062d833d11c5245eda50f5108e0e55324 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add SessionPoolOptions, SpannerOptions protos in executor protos PiperOrigin-RevId: 621265883 Source-Link: https://github.com/googleapis/googleapis/commit/fed9845c564d6acf8d03beee69b36666c8bd7fa4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c66a76957e2e16347bc1dd3f4c638223f065ee80 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzY2YTc2OTU3ZTJlMTYzNDdiYzFkZDNmNGM2MzgyMjNmMDY1ZWU4MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(spanner): adding `EXPECTED_FULFILLMENT_PERIOD` to the indicate instance creation times (with `FULFILLMENT_PERIOD_NORMAL` or `FULFILLMENT_PERIOD_EXTENDED` ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature PiperOrigin-RevId: 621488048 Source-Link: https://github.com/googleapis/googleapis/commit/0aa0992a5430c211a73c9b861d65e1e8a7a91a9e Source-Link: https://github.com/googleapis/googleapis-gen/commit/b8ad4c73a5c05fed8bcfddb931326996c3441791 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhhZDRjNzNhNWMwNWZlZDhiY2ZkZGI5MzEzMjY5OTZjMzQ0MTc5MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: danieljbruce --- .gitignore | 1 - .../spanner/admin/instance/v1/common.proto | 16 +- .../instance/v1/spanner_instance_admin.proto | 6 + .../spanner/executor/v1/cloud_executor.proto | 34 +- protos/protos.d.ts | 311 ++++++- protos/protos.js | 774 ++++++++++++++++-- protos/protos.json | 51 +- src/v1/database_admin_client.ts | 15 +- src/v1/instance_admin_client.ts | 15 +- src/v1/spanner_client.ts | 15 +- src/v1/spanner_executor_proxy_client.ts | 15 +- test/gapic_database_admin_v1.ts | 34 +- test/gapic_instance_admin_v1.ts | 34 +- test/gapic_spanner_executor_proxy_v1.ts | 39 +- test/gapic_spanner_v1.ts | 34 +- 15 files changed, 1239 insertions(+), 155 deletions(-) diff --git a/.gitignore b/.gitignore index 14050d4e4..d4f03a0df 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,3 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ -.vscode \ No newline at end of file diff --git a/protos/google/spanner/admin/instance/v1/common.proto b/protos/google/spanner/admin/instance/v1/common.proto index ffb69748f..ab6293acf 100644 --- a/protos/google/spanner/admin/instance/v1/common.proto +++ b/protos/google/spanner/admin/instance/v1/common.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. @@ -40,3 +40,17 @@ message OperationProgress { // successfully. google.protobuf.Timestamp end_time = 3; } + +// Indicates the expected fulfillment period of an operation. +enum FulfillmentPeriod { + // Not specified. + FULFILLMENT_PERIOD_UNSPECIFIED = 0; + + // Normal fulfillment period. The operation is expected to complete within + // minutes. + FULFILLMENT_PERIOD_NORMAL = 1; + + // Extended fulfillment period. It can take up to an hour for the operation + // to complete. + FULFILLMENT_PERIOD_EXTENDED = 2; +} 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 836b9063f..499bd8603 100644 --- a/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ b/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -1282,6 +1282,9 @@ message CreateInstanceMetadata { // The time at which this operation failed or was completed successfully. google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this create operation. + FulfillmentPeriod expected_fulfillment_period = 5; } // Metadata type for the operation returned by @@ -1302,6 +1305,9 @@ message UpdateInstanceMetadata { // The time at which this operation failed or was completed successfully. google.protobuf.Timestamp end_time = 4; + + // The expected fulfillment period of this update operation. + FulfillmentPeriod expected_fulfillment_period = 5; } // Metadata type for the operation returned by diff --git a/protos/google/spanner/executor/v1/cloud_executor.proto b/protos/google/spanner/executor/v1/cloud_executor.proto index 56332dc0e..3ad36e3ee 100644 --- a/protos/google/spanner/executor/v1/cloud_executor.proto +++ b/protos/google/spanner/executor/v1/cloud_executor.proto @@ -78,6 +78,9 @@ message SpannerAction { // database path if it applies to the same database as the previous action. string database_path = 1; + // Configuration options for Spanner backend + SpannerOptions spanner_options = 2; + // Action represents a spanner action kind, there will only be one action kind // per SpannerAction. oneof action { @@ -565,8 +568,8 @@ message AdminAction { // Action that cancels an operation. CancelOperationAction cancel_operation = 26; - // Action that reconfigures a Cloud Spanner database. - ReconfigureCloudDatabaseAction reconfigure_cloud_database = 28; + // Action that changes quorum of a Cloud Spanner database. + ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28; } } @@ -772,9 +775,9 @@ message DropCloudDatabaseAction { string database_id = 3; } -// Action that reconfigures a Cloud Spanner database. -message ReconfigureCloudDatabaseAction { - // The fully qualified uri of the database to be reconfigured. +// Action that changes quorum of a Cloud Spanner database. +message ChangeQuorumCloudDatabaseAction { + // The fully qualified uri of the database whose quorum has to be changed. optional string database_uri = 1; // The locations of the serving regions, e.g. "asia-south1". @@ -877,6 +880,10 @@ message RestoreCloudDatabaseAction { // The id of the database to create and restore to, e.g. "db0". Note that this // database must not already exist. string database_id = 5; + + // The KMS key(s) used to encrypt the restored database to be created if the + // restored database should be CMEK protected. + google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; } // Action that gets a Cloud Spanner database. @@ -916,6 +923,10 @@ message CreateCloudBackupAction { // [earliest_version_time, NOW], where earliest_version_time is retrieved by // cloud spanner frontend API (See details: go/cs-pitr-lite-design). optional google.protobuf.Timestamp version_time = 6; + + // The KMS key(s) used to encrypt the backup to be created if the backup + // should be CMEK protected. + google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7; } // Action that copies a Cloud Spanner database backup. @@ -1481,3 +1492,16 @@ message HeartbeatRecord { // Timestamp for this heartbeat check. google.protobuf.Timestamp heartbeat_time = 1; } + +// Options for Cloud Spanner Service. +message SpannerOptions { + // Options for configuring the session pool + SessionPoolOptions session_pool_options = 1; +} + +// Options for the session pool used by the DatabaseClient. +message SessionPoolOptions { + // passing this as true, will make applicable RPCs use multiplexed sessions + // instead of regular sessions + bool use_multiplexed = 1; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 074ba8102..98bfcb679 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -11807,6 +11807,13 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** FulfillmentPeriod enum. */ + enum FulfillmentPeriod { + FULFILLMENT_PERIOD_UNSPECIFIED = 0, + FULFILLMENT_PERIOD_NORMAL = 1, + FULFILLMENT_PERIOD_EXTENDED = 2 + } + /** Represents an InstanceAdmin */ class InstanceAdmin extends $protobuf.rpc.Service { @@ -14558,6 +14565,9 @@ export namespace google { /** CreateInstanceMetadata endTime */ endTime?: (google.protobuf.ITimestamp|null); + + /** CreateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); } /** Represents a CreateInstanceMetadata. */ @@ -14581,6 +14591,9 @@ export namespace google { /** CreateInstanceMetadata endTime. */ public endTime?: (google.protobuf.ITimestamp|null); + /** CreateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + /** * Creates a new CreateInstanceMetadata instance using the specified properties. * @param [properties] Properties to set @@ -14673,6 +14686,9 @@ export namespace google { /** UpdateInstanceMetadata endTime */ endTime?: (google.protobuf.ITimestamp|null); + + /** UpdateInstanceMetadata expectedFulfillmentPeriod */ + expectedFulfillmentPeriod?: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod|null); } /** Represents an UpdateInstanceMetadata. */ @@ -14696,6 +14712,9 @@ export namespace google { /** UpdateInstanceMetadata endTime. */ public endTime?: (google.protobuf.ITimestamp|null); + /** UpdateInstanceMetadata expectedFulfillmentPeriod. */ + public expectedFulfillmentPeriod: (google.spanner.admin.instance.v1.FulfillmentPeriod|keyof typeof google.spanner.admin.instance.v1.FulfillmentPeriod); + /** * Creates a new UpdateInstanceMetadata instance using the specified properties. * @param [properties] Properties to set @@ -16524,6 +16543,9 @@ export namespace google { /** SpannerAction databasePath */ databasePath?: (string|null); + /** SpannerAction spannerOptions */ + spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); + /** SpannerAction start */ start?: (google.spanner.executor.v1.IStartTransactionAction|null); @@ -16585,6 +16607,9 @@ export namespace google { /** SpannerAction databasePath. */ public databasePath: string; + /** SpannerAction spannerOptions. */ + public spannerOptions?: (google.spanner.executor.v1.ISpannerOptions|null); + /** SpannerAction start. */ public start?: (google.spanner.executor.v1.IStartTransactionAction|null); @@ -19284,8 +19309,8 @@ export namespace google { /** AdminAction cancelOperation */ cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); - /** AdminAction reconfigureCloudDatabase */ - reconfigureCloudDatabase?: (google.spanner.executor.v1.IReconfigureCloudDatabaseAction|null); + /** AdminAction changeQuorumCloudDatabase */ + changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); } /** Represents an AdminAction. */ @@ -19378,11 +19403,11 @@ export namespace google { /** AdminAction cancelOperation. */ public cancelOperation?: (google.spanner.executor.v1.ICancelOperationAction|null); - /** AdminAction reconfigureCloudDatabase. */ - public reconfigureCloudDatabase?: (google.spanner.executor.v1.IReconfigureCloudDatabaseAction|null); + /** AdminAction changeQuorumCloudDatabase. */ + public changeQuorumCloudDatabase?: (google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null); /** AdminAction action. */ - public action?: ("createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"reconfigureCloudDatabase"); + public action?: ("createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"); /** * Creates a new AdminAction instance using the specified properties. @@ -20899,106 +20924,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReconfigureCloudDatabaseAction. */ - interface IReconfigureCloudDatabaseAction { + /** Properties of a ChangeQuorumCloudDatabaseAction. */ + interface IChangeQuorumCloudDatabaseAction { - /** ReconfigureCloudDatabaseAction databaseUri */ + /** ChangeQuorumCloudDatabaseAction databaseUri */ databaseUri?: (string|null); - /** ReconfigureCloudDatabaseAction servingLocations */ + /** ChangeQuorumCloudDatabaseAction servingLocations */ servingLocations?: (string[]|null); } - /** Represents a ReconfigureCloudDatabaseAction. */ - class ReconfigureCloudDatabaseAction implements IReconfigureCloudDatabaseAction { + /** Represents a ChangeQuorumCloudDatabaseAction. */ + class ChangeQuorumCloudDatabaseAction implements IChangeQuorumCloudDatabaseAction { /** - * Constructs a new ReconfigureCloudDatabaseAction. + * Constructs a new ChangeQuorumCloudDatabaseAction. * @param [properties] Properties to set */ - constructor(properties?: google.spanner.executor.v1.IReconfigureCloudDatabaseAction); + constructor(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction); - /** ReconfigureCloudDatabaseAction databaseUri. */ + /** ChangeQuorumCloudDatabaseAction databaseUri. */ public databaseUri?: (string|null); - /** ReconfigureCloudDatabaseAction servingLocations. */ + /** ChangeQuorumCloudDatabaseAction servingLocations. */ public servingLocations: string[]; - /** ReconfigureCloudDatabaseAction _databaseUri. */ + /** ChangeQuorumCloudDatabaseAction _databaseUri. */ public _databaseUri?: "databaseUri"; /** - * Creates a new ReconfigureCloudDatabaseAction instance using the specified properties. + * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. * @param [properties] Properties to set - * @returns ReconfigureCloudDatabaseAction instance + * @returns ChangeQuorumCloudDatabaseAction instance */ - public static create(properties?: google.spanner.executor.v1.IReconfigureCloudDatabaseAction): google.spanner.executor.v1.ReconfigureCloudDatabaseAction; + public static create(properties?: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; /** - * Encodes the specified ReconfigureCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ReconfigureCloudDatabaseAction.verify|verify} messages. - * @param message ReconfigureCloudDatabaseAction message or plain object to encode + * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.spanner.executor.v1.IReconfigureCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReconfigureCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReconfigureCloudDatabaseAction.verify|verify} messages. - * @param message ReconfigureCloudDatabaseAction message or plain object to encode + * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. + * @param message ChangeQuorumCloudDatabaseAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.spanner.executor.v1.IReconfigureCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReconfigureCloudDatabaseAction message from the specified reader or buffer. + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReconfigureCloudDatabaseAction + * @returns ChangeQuorumCloudDatabaseAction * @throws {Error} If the payload is not 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.executor.v1.ReconfigureCloudDatabaseAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; /** - * Decodes a ReconfigureCloudDatabaseAction message from the specified reader or buffer, length delimited. + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReconfigureCloudDatabaseAction + * @returns ChangeQuorumCloudDatabaseAction * @throws {Error} If the payload 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.executor.v1.ReconfigureCloudDatabaseAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; /** - * Verifies a ReconfigureCloudDatabaseAction message. + * Verifies a ChangeQuorumCloudDatabaseAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReconfigureCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReconfigureCloudDatabaseAction + * @returns ChangeQuorumCloudDatabaseAction */ - public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ReconfigureCloudDatabaseAction; + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction; /** - * Creates a plain object from a ReconfigureCloudDatabaseAction message. Also converts values to other types if specified. - * @param message ReconfigureCloudDatabaseAction + * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. + * @param message ChangeQuorumCloudDatabaseAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.spanner.executor.v1.ReconfigureCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReconfigureCloudDatabaseAction to JSON. + * Converts this ChangeQuorumCloudDatabaseAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReconfigureCloudDatabaseAction + * Gets the default type url for ChangeQuorumCloudDatabaseAction * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -21485,6 +21510,9 @@ export namespace google { /** RestoreCloudDatabaseAction databaseId */ databaseId?: (string|null); + + /** RestoreCloudDatabaseAction encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); } /** Represents a RestoreCloudDatabaseAction. */ @@ -21511,6 +21539,9 @@ export namespace google { /** RestoreCloudDatabaseAction databaseId. */ public databaseId: string; + /** RestoreCloudDatabaseAction encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + /** * Creates a new RestoreCloudDatabaseAction instance using the specified properties. * @param [properties] Properties to set @@ -21718,6 +21749,9 @@ export namespace google { /** CreateCloudBackupAction versionTime */ versionTime?: (google.protobuf.ITimestamp|null); + + /** CreateCloudBackupAction encryptionConfig */ + encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); } /** Represents a CreateCloudBackupAction. */ @@ -21747,6 +21781,9 @@ export namespace google { /** CreateCloudBackupAction versionTime. */ public versionTime?: (google.protobuf.ITimestamp|null); + /** CreateCloudBackupAction encryptionConfig. */ + public encryptionConfig?: (google.spanner.admin.database.v1.IEncryptionConfig|null); + /** CreateCloudBackupAction _versionTime. */ public _versionTime?: "versionTime"; @@ -25431,6 +25468,200 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a SpannerOptions. */ + interface ISpannerOptions { + + /** SpannerOptions sessionPoolOptions */ + sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); + } + + /** Represents a SpannerOptions. */ + class SpannerOptions implements ISpannerOptions { + + /** + * Constructs a new SpannerOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISpannerOptions); + + /** SpannerOptions sessionPoolOptions. */ + public sessionPoolOptions?: (google.spanner.executor.v1.ISessionPoolOptions|null); + + /** + * Creates a new SpannerOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerOptions instance + */ + public static create(properties?: google.spanner.executor.v1.ISpannerOptions): google.spanner.executor.v1.SpannerOptions; + + /** + * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @param message SpannerOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @param message SpannerOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISpannerOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerOptions + * @throws {Error} If the payload is not 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.executor.v1.SpannerOptions; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerOptions + * @throws {Error} If the payload 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.executor.v1.SpannerOptions; + + /** + * Verifies a SpannerOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SpannerOptions; + + /** + * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. + * @param message SpannerOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SpannerOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionPoolOptions. */ + interface ISessionPoolOptions { + + /** SessionPoolOptions useMultiplexed */ + useMultiplexed?: (boolean|null); + } + + /** Represents a SessionPoolOptions. */ + class SessionPoolOptions implements ISessionPoolOptions { + + /** + * Constructs a new SessionPoolOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.spanner.executor.v1.ISessionPoolOptions); + + /** SessionPoolOptions useMultiplexed. */ + public useMultiplexed: boolean; + + /** + * Creates a new SessionPoolOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionPoolOptions instance + */ + public static create(properties?: google.spanner.executor.v1.ISessionPoolOptions): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @param message SessionPoolOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @param message SessionPoolOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.spanner.executor.v1.ISessionPoolOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionPoolOptions + * @throws {Error} If the payload is not 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.executor.v1.SessionPoolOptions; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionPoolOptions + * @throws {Error} If the payload 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.executor.v1.SessionPoolOptions; + + /** + * Verifies a SessionPoolOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionPoolOptions + */ + public static fromObject(object: { [k: string]: any }): google.spanner.executor.v1.SessionPoolOptions; + + /** + * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. + * @param message SessionPoolOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.spanner.executor.v1.SessionPoolOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionPoolOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionPoolOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } diff --git a/protos/protos.js b/protos/protos.js index 67e64d3a6..feb8d0198 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -30357,6 +30357,22 @@ return OperationProgress; })(); + /** + * FulfillmentPeriod enum. + * @name google.spanner.admin.instance.v1.FulfillmentPeriod + * @enum {number} + * @property {number} FULFILLMENT_PERIOD_UNSPECIFIED=0 FULFILLMENT_PERIOD_UNSPECIFIED value + * @property {number} FULFILLMENT_PERIOD_NORMAL=1 FULFILLMENT_PERIOD_NORMAL value + * @property {number} FULFILLMENT_PERIOD_EXTENDED=2 FULFILLMENT_PERIOD_EXTENDED value + */ + v1.FulfillmentPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULFILLMENT_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULFILLMENT_PERIOD_NORMAL"] = 1; + values[valuesById[2] = "FULFILLMENT_PERIOD_EXTENDED"] = 2; + return values; + })(); + v1.InstanceAdmin = (function() { /** @@ -36818,6 +36834,7 @@ * @property {google.protobuf.ITimestamp|null} [startTime] CreateInstanceMetadata startTime * @property {google.protobuf.ITimestamp|null} [cancelTime] CreateInstanceMetadata cancelTime * @property {google.protobuf.ITimestamp|null} [endTime] CreateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] CreateInstanceMetadata expectedFulfillmentPeriod */ /** @@ -36867,6 +36884,14 @@ */ CreateInstanceMetadata.prototype.endTime = null; + /** + * CreateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.CreateInstanceMetadata + * @instance + */ + CreateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + /** * Creates a new CreateInstanceMetadata instance using the specified properties. * @function create @@ -36899,6 +36924,8 @@ $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); return writer; }; @@ -36949,6 +36976,10 @@ message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -37004,6 +37035,15 @@ if (error) return "endTime." + error; } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -37039,6 +37079,26 @@ throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } return message; }; @@ -37060,6 +37120,7 @@ object.startTime = null; object.cancelTime = null; object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; } if (message.instance != null && message.hasOwnProperty("instance")) object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); @@ -37069,6 +37130,8 @@ object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); if (message.endTime != null && message.hasOwnProperty("endTime")) object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; return object; }; @@ -37111,6 +37174,7 @@ * @property {google.protobuf.ITimestamp|null} [startTime] UpdateInstanceMetadata startTime * @property {google.protobuf.ITimestamp|null} [cancelTime] UpdateInstanceMetadata cancelTime * @property {google.protobuf.ITimestamp|null} [endTime] UpdateInstanceMetadata endTime + * @property {google.spanner.admin.instance.v1.FulfillmentPeriod|null} [expectedFulfillmentPeriod] UpdateInstanceMetadata expectedFulfillmentPeriod */ /** @@ -37160,6 +37224,14 @@ */ UpdateInstanceMetadata.prototype.endTime = null; + /** + * UpdateInstanceMetadata expectedFulfillmentPeriod. + * @member {google.spanner.admin.instance.v1.FulfillmentPeriod} expectedFulfillmentPeriod + * @memberof google.spanner.admin.instance.v1.UpdateInstanceMetadata + * @instance + */ + UpdateInstanceMetadata.prototype.expectedFulfillmentPeriod = 0; + /** * Creates a new UpdateInstanceMetadata instance using the specified properties. * @function create @@ -37192,6 +37264,8 @@ $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); return writer; }; @@ -37242,6 +37316,10 @@ message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 5: { + message.expectedFulfillmentPeriod = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -37297,6 +37375,15 @@ if (error) return "endTime." + error; } + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + switch (message.expectedFulfillmentPeriod) { + default: + return "expectedFulfillmentPeriod: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -37332,6 +37419,26 @@ throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } + switch (object.expectedFulfillmentPeriod) { + default: + if (typeof object.expectedFulfillmentPeriod === "number") { + message.expectedFulfillmentPeriod = object.expectedFulfillmentPeriod; + break; + } + break; + case "FULFILLMENT_PERIOD_UNSPECIFIED": + case 0: + message.expectedFulfillmentPeriod = 0; + break; + case "FULFILLMENT_PERIOD_NORMAL": + case 1: + message.expectedFulfillmentPeriod = 1; + break; + case "FULFILLMENT_PERIOD_EXTENDED": + case 2: + message.expectedFulfillmentPeriod = 2; + break; + } return message; }; @@ -37353,6 +37460,7 @@ object.startTime = null; object.cancelTime = null; object.endTime = null; + object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; } if (message.instance != null && message.hasOwnProperty("instance")) object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); @@ -37362,6 +37470,8 @@ object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); if (message.endTime != null && message.hasOwnProperty("endTime")) object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; return object; }; @@ -41696,6 +41806,7 @@ * @memberof google.spanner.executor.v1 * @interface ISpannerAction * @property {string|null} [databasePath] SpannerAction databasePath + * @property {google.spanner.executor.v1.ISpannerOptions|null} [spannerOptions] SpannerAction spannerOptions * @property {google.spanner.executor.v1.IStartTransactionAction|null} [start] SpannerAction start * @property {google.spanner.executor.v1.IFinishTransactionAction|null} [finish] SpannerAction finish * @property {google.spanner.executor.v1.IReadAction|null} [read] SpannerAction read @@ -41737,6 +41848,14 @@ */ SpannerAction.prototype.databasePath = ""; + /** + * SpannerAction spannerOptions. + * @member {google.spanner.executor.v1.ISpannerOptions|null|undefined} spannerOptions + * @memberof google.spanner.executor.v1.SpannerAction + * @instance + */ + SpannerAction.prototype.spannerOptions = null; + /** * SpannerAction start. * @member {google.spanner.executor.v1.IStartTransactionAction|null|undefined} start @@ -41905,6 +42024,8 @@ writer = $Writer.create(); if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databasePath); + if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) + $root.google.spanner.executor.v1.SpannerOptions.encode(message.spannerOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) $root.google.spanner.executor.v1.StartTransactionAction.encode(message.start, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) @@ -41975,6 +42096,10 @@ message.databasePath = reader.string(); break; } + case 2: { + message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.decode(reader, reader.uint32()); + break; + } case 10: { message.start = $root.google.spanner.executor.v1.StartTransactionAction.decode(reader, reader.uint32()); break; @@ -42078,6 +42203,11 @@ if (message.databasePath != null && message.hasOwnProperty("databasePath")) if (!$util.isString(message.databasePath)) return "databasePath: string expected"; + if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) { + var error = $root.google.spanner.executor.v1.SpannerOptions.verify(message.spannerOptions); + if (error) + return "spannerOptions." + error; + } if (message.start != null && message.hasOwnProperty("start")) { properties.action = 1; { @@ -42253,6 +42383,11 @@ var message = new $root.google.spanner.executor.v1.SpannerAction(); if (object.databasePath != null) message.databasePath = String(object.databasePath); + if (object.spannerOptions != null) { + if (typeof object.spannerOptions !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerAction.spannerOptions: object expected"); + message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.fromObject(object.spannerOptions); + } if (object.start != null) { if (typeof object.start !== "object") throw TypeError(".google.spanner.executor.v1.SpannerAction.start: object expected"); @@ -42349,10 +42484,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.databasePath = ""; + object.spannerOptions = null; + } if (message.databasePath != null && message.hasOwnProperty("databasePath")) object.databasePath = message.databasePath; + if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) + object.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.toObject(message.spannerOptions, options); if (message.start != null && message.hasOwnProperty("start")) { object.start = $root.google.spanner.executor.v1.StartTransactionAction.toObject(message.start, options); if (options.oneofs) @@ -48971,7 +49110,7 @@ * @property {google.spanner.executor.v1.IListCloudBackupOperationsAction|null} [listCloudBackupOperations] AdminAction listCloudBackupOperations * @property {google.spanner.executor.v1.IGetOperationAction|null} [getOperation] AdminAction getOperation * @property {google.spanner.executor.v1.ICancelOperationAction|null} [cancelOperation] AdminAction cancelOperation - * @property {google.spanner.executor.v1.IReconfigureCloudDatabaseAction|null} [reconfigureCloudDatabase] AdminAction reconfigureCloudDatabase + * @property {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null} [changeQuorumCloudDatabase] AdminAction changeQuorumCloudDatabase */ /** @@ -49206,24 +49345,24 @@ AdminAction.prototype.cancelOperation = null; /** - * AdminAction reconfigureCloudDatabase. - * @member {google.spanner.executor.v1.IReconfigureCloudDatabaseAction|null|undefined} reconfigureCloudDatabase + * AdminAction changeQuorumCloudDatabase. + * @member {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction|null|undefined} changeQuorumCloudDatabase * @memberof google.spanner.executor.v1.AdminAction * @instance */ - AdminAction.prototype.reconfigureCloudDatabase = null; + AdminAction.prototype.changeQuorumCloudDatabase = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * AdminAction action. - * @member {"createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"reconfigureCloudDatabase"|undefined} action + * @member {"createUserInstanceConfig"|"updateUserInstanceConfig"|"deleteUserInstanceConfig"|"getCloudInstanceConfig"|"listInstanceConfigs"|"createCloudInstance"|"updateCloudInstance"|"deleteCloudInstance"|"listCloudInstances"|"getCloudInstance"|"createCloudDatabase"|"updateCloudDatabaseDdl"|"updateCloudDatabase"|"dropCloudDatabase"|"listCloudDatabases"|"listCloudDatabaseOperations"|"restoreCloudDatabase"|"getCloudDatabase"|"createCloudBackup"|"copyCloudBackup"|"getCloudBackup"|"updateCloudBackup"|"deleteCloudBackup"|"listCloudBackups"|"listCloudBackupOperations"|"getOperation"|"cancelOperation"|"changeQuorumCloudDatabase"|undefined} action * @memberof google.spanner.executor.v1.AdminAction * @instance */ Object.defineProperty(AdminAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["createUserInstanceConfig", "updateUserInstanceConfig", "deleteUserInstanceConfig", "getCloudInstanceConfig", "listInstanceConfigs", "createCloudInstance", "updateCloudInstance", "deleteCloudInstance", "listCloudInstances", "getCloudInstance", "createCloudDatabase", "updateCloudDatabaseDdl", "updateCloudDatabase", "dropCloudDatabase", "listCloudDatabases", "listCloudDatabaseOperations", "restoreCloudDatabase", "getCloudDatabase", "createCloudBackup", "copyCloudBackup", "getCloudBackup", "updateCloudBackup", "deleteCloudBackup", "listCloudBackups", "listCloudBackupOperations", "getOperation", "cancelOperation", "reconfigureCloudDatabase"]), + get: $util.oneOfGetter($oneOfFields = ["createUserInstanceConfig", "updateUserInstanceConfig", "deleteUserInstanceConfig", "getCloudInstanceConfig", "listInstanceConfigs", "createCloudInstance", "updateCloudInstance", "deleteCloudInstance", "listCloudInstances", "getCloudInstance", "createCloudDatabase", "updateCloudDatabaseDdl", "updateCloudDatabase", "dropCloudDatabase", "listCloudDatabases", "listCloudDatabaseOperations", "restoreCloudDatabase", "getCloudDatabase", "createCloudBackup", "copyCloudBackup", "getCloudBackup", "updateCloudBackup", "deleteCloudBackup", "listCloudBackups", "listCloudBackupOperations", "getOperation", "cancelOperation", "changeQuorumCloudDatabase"]), set: $util.oneOfSetter($oneOfFields) }); @@ -49305,8 +49444,8 @@ $root.google.spanner.executor.v1.CancelOperationAction.encode(message.cancelOperation, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.encode(message.updateCloudDatabase, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.reconfigureCloudDatabase != null && Object.hasOwnProperty.call(message, "reconfigureCloudDatabase")) - $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction.encode(message.reconfigureCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) + $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.encode(message.changeQuorumCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); return writer; }; @@ -49450,7 +49589,7 @@ break; } case 28: { - message.reconfigureCloudDatabase = $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction.decode(reader, reader.uint32()); + message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.decode(reader, reader.uint32()); break; } default: @@ -49757,14 +49896,14 @@ return "cancelOperation." + error; } } - if (message.reconfigureCloudDatabase != null && message.hasOwnProperty("reconfigureCloudDatabase")) { + if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; { - var error = $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction.verify(message.reconfigureCloudDatabase); + var error = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify(message.changeQuorumCloudDatabase); if (error) - return "reconfigureCloudDatabase." + error; + return "changeQuorumCloudDatabase." + error; } } return null; @@ -49917,10 +50056,10 @@ throw TypeError(".google.spanner.executor.v1.AdminAction.cancelOperation: object expected"); message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.fromObject(object.cancelOperation); } - if (object.reconfigureCloudDatabase != null) { - if (typeof object.reconfigureCloudDatabase !== "object") - throw TypeError(".google.spanner.executor.v1.AdminAction.reconfigureCloudDatabase: object expected"); - message.reconfigureCloudDatabase = $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction.fromObject(object.reconfigureCloudDatabase); + if (object.changeQuorumCloudDatabase != null) { + if (typeof object.changeQuorumCloudDatabase !== "object") + throw TypeError(".google.spanner.executor.v1.AdminAction.changeQuorumCloudDatabase: object expected"); + message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.fromObject(object.changeQuorumCloudDatabase); } return message; }; @@ -50073,10 +50212,10 @@ if (options.oneofs) object.action = "updateCloudDatabase"; } - if (message.reconfigureCloudDatabase != null && message.hasOwnProperty("reconfigureCloudDatabase")) { - object.reconfigureCloudDatabase = $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction.toObject(message.reconfigureCloudDatabase, options); + if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { + object.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.toObject(message.changeQuorumCloudDatabase, options); if (options.oneofs) - object.action = "reconfigureCloudDatabase"; + object.action = "changeQuorumCloudDatabase"; } return object; }; @@ -53860,25 +53999,25 @@ return DropCloudDatabaseAction; })(); - v1.ReconfigureCloudDatabaseAction = (function() { + v1.ChangeQuorumCloudDatabaseAction = (function() { /** - * Properties of a ReconfigureCloudDatabaseAction. + * Properties of a ChangeQuorumCloudDatabaseAction. * @memberof google.spanner.executor.v1 - * @interface IReconfigureCloudDatabaseAction - * @property {string|null} [databaseUri] ReconfigureCloudDatabaseAction databaseUri - * @property {Array.|null} [servingLocations] ReconfigureCloudDatabaseAction servingLocations + * @interface IChangeQuorumCloudDatabaseAction + * @property {string|null} [databaseUri] ChangeQuorumCloudDatabaseAction databaseUri + * @property {Array.|null} [servingLocations] ChangeQuorumCloudDatabaseAction servingLocations */ /** - * Constructs a new ReconfigureCloudDatabaseAction. + * Constructs a new ChangeQuorumCloudDatabaseAction. * @memberof google.spanner.executor.v1 - * @classdesc Represents a ReconfigureCloudDatabaseAction. - * @implements IReconfigureCloudDatabaseAction + * @classdesc Represents a ChangeQuorumCloudDatabaseAction. + * @implements IChangeQuorumCloudDatabaseAction * @constructor - * @param {google.spanner.executor.v1.IReconfigureCloudDatabaseAction=} [properties] Properties to set + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set */ - function ReconfigureCloudDatabaseAction(properties) { + function ChangeQuorumCloudDatabaseAction(properties) { this.servingLocations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -53887,57 +54026,57 @@ } /** - * ReconfigureCloudDatabaseAction databaseUri. + * ChangeQuorumCloudDatabaseAction databaseUri. * @member {string|null|undefined} databaseUri - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @instance */ - ReconfigureCloudDatabaseAction.prototype.databaseUri = null; + ChangeQuorumCloudDatabaseAction.prototype.databaseUri = null; /** - * ReconfigureCloudDatabaseAction servingLocations. + * ChangeQuorumCloudDatabaseAction servingLocations. * @member {Array.} servingLocations - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @instance */ - ReconfigureCloudDatabaseAction.prototype.servingLocations = $util.emptyArray; + ChangeQuorumCloudDatabaseAction.prototype.servingLocations = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * ReconfigureCloudDatabaseAction _databaseUri. + * ChangeQuorumCloudDatabaseAction _databaseUri. * @member {"databaseUri"|undefined} _databaseUri - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @instance */ - Object.defineProperty(ReconfigureCloudDatabaseAction.prototype, "_databaseUri", { + Object.defineProperty(ChangeQuorumCloudDatabaseAction.prototype, "_databaseUri", { get: $util.oneOfGetter($oneOfFields = ["databaseUri"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new ReconfigureCloudDatabaseAction instance using the specified properties. + * Creates a new ChangeQuorumCloudDatabaseAction instance using the specified properties. * @function create - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static - * @param {google.spanner.executor.v1.IReconfigureCloudDatabaseAction=} [properties] Properties to set - * @returns {google.spanner.executor.v1.ReconfigureCloudDatabaseAction} ReconfigureCloudDatabaseAction instance + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction=} [properties] Properties to set + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction instance */ - ReconfigureCloudDatabaseAction.create = function create(properties) { - return new ReconfigureCloudDatabaseAction(properties); + ChangeQuorumCloudDatabaseAction.create = function create(properties) { + return new ChangeQuorumCloudDatabaseAction(properties); }; /** - * Encodes the specified ReconfigureCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ReconfigureCloudDatabaseAction.verify|verify} messages. + * Encodes the specified ChangeQuorumCloudDatabaseAction message. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. * @function encode - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static - * @param {google.spanner.executor.v1.IReconfigureCloudDatabaseAction} message ReconfigureCloudDatabaseAction message or plain object to encode + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconfigureCloudDatabaseAction.encode = function encode(message, writer) { + ChangeQuorumCloudDatabaseAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) @@ -53949,33 +54088,33 @@ }; /** - * Encodes the specified ReconfigureCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ReconfigureCloudDatabaseAction.verify|verify} messages. + * Encodes the specified ChangeQuorumCloudDatabaseAction message, length delimited. Does not implicitly {@link google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static - * @param {google.spanner.executor.v1.IReconfigureCloudDatabaseAction} message ReconfigureCloudDatabaseAction message or plain object to encode + * @param {google.spanner.executor.v1.IChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReconfigureCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { + ChangeQuorumCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReconfigureCloudDatabaseAction message from the specified reader or buffer. + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer. * @function decode - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.spanner.executor.v1.ReconfigureCloudDatabaseAction} ReconfigureCloudDatabaseAction + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconfigureCloudDatabaseAction.decode = function decode(reader, length) { + ChangeQuorumCloudDatabaseAction.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.executor.v1.ReconfigureCloudDatabaseAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -53998,30 +54137,30 @@ }; /** - * Decodes a ReconfigureCloudDatabaseAction message from the specified reader or buffer, length delimited. + * Decodes a ChangeQuorumCloudDatabaseAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.spanner.executor.v1.ReconfigureCloudDatabaseAction} ReconfigureCloudDatabaseAction + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReconfigureCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { + ChangeQuorumCloudDatabaseAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReconfigureCloudDatabaseAction message. + * Verifies a ChangeQuorumCloudDatabaseAction message. * @function verify - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReconfigureCloudDatabaseAction.verify = function verify(message) { + ChangeQuorumCloudDatabaseAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; @@ -54041,22 +54180,22 @@ }; /** - * Creates a ReconfigureCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. + * Creates a ChangeQuorumCloudDatabaseAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static * @param {Object.} object Plain object - * @returns {google.spanner.executor.v1.ReconfigureCloudDatabaseAction} ReconfigureCloudDatabaseAction + * @returns {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} ChangeQuorumCloudDatabaseAction */ - ReconfigureCloudDatabaseAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction) + ChangeQuorumCloudDatabaseAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction) return object; - var message = new $root.google.spanner.executor.v1.ReconfigureCloudDatabaseAction(); + var message = new $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction(); if (object.databaseUri != null) message.databaseUri = String(object.databaseUri); if (object.servingLocations) { if (!Array.isArray(object.servingLocations)) - throw TypeError(".google.spanner.executor.v1.ReconfigureCloudDatabaseAction.servingLocations: array expected"); + throw TypeError(".google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.servingLocations: array expected"); message.servingLocations = []; for (var i = 0; i < object.servingLocations.length; ++i) message.servingLocations[i] = String(object.servingLocations[i]); @@ -54065,15 +54204,15 @@ }; /** - * Creates a plain object from a ReconfigureCloudDatabaseAction message. Also converts values to other types if specified. + * Creates a plain object from a ChangeQuorumCloudDatabaseAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static - * @param {google.spanner.executor.v1.ReconfigureCloudDatabaseAction} message ReconfigureCloudDatabaseAction + * @param {google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction} message ChangeQuorumCloudDatabaseAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReconfigureCloudDatabaseAction.toObject = function toObject(message, options) { + ChangeQuorumCloudDatabaseAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -54093,32 +54232,32 @@ }; /** - * Converts this ReconfigureCloudDatabaseAction to JSON. + * Converts this ChangeQuorumCloudDatabaseAction to JSON. * @function toJSON - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @instance * @returns {Object.} JSON object */ - ReconfigureCloudDatabaseAction.prototype.toJSON = function toJSON() { + ChangeQuorumCloudDatabaseAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReconfigureCloudDatabaseAction + * Gets the default type url for ChangeQuorumCloudDatabaseAction * @function getTypeUrl - * @memberof google.spanner.executor.v1.ReconfigureCloudDatabaseAction + * @memberof google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReconfigureCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ChangeQuorumCloudDatabaseAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.spanner.executor.v1.ReconfigureCloudDatabaseAction"; + return typeUrlPrefix + "/google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction"; }; - return ReconfigureCloudDatabaseAction; + return ChangeQuorumCloudDatabaseAction; })(); v1.ListCloudDatabasesAction = (function() { @@ -55249,6 +55388,7 @@ * @property {string|null} [backupId] RestoreCloudDatabaseAction backupId * @property {string|null} [databaseInstanceId] RestoreCloudDatabaseAction databaseInstanceId * @property {string|null} [databaseId] RestoreCloudDatabaseAction databaseId + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] RestoreCloudDatabaseAction encryptionConfig */ /** @@ -55306,6 +55446,14 @@ */ RestoreCloudDatabaseAction.prototype.databaseId = ""; + /** + * RestoreCloudDatabaseAction encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.executor.v1.RestoreCloudDatabaseAction + * @instance + */ + RestoreCloudDatabaseAction.prototype.encryptionConfig = null; + /** * Creates a new RestoreCloudDatabaseAction instance using the specified properties. * @function create @@ -55340,6 +55488,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseInstanceId); if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.databaseId); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -55394,6 +55544,10 @@ message.databaseId = reader.string(); break; } + case 7: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -55444,6 +55598,11 @@ if (message.databaseId != null && message.hasOwnProperty("databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } return null; }; @@ -55469,6 +55628,11 @@ message.databaseInstanceId = String(object.databaseInstanceId); if (object.databaseId != null) message.databaseId = String(object.databaseId); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.executor.v1.RestoreCloudDatabaseAction.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } return message; }; @@ -55491,6 +55655,7 @@ object.backupId = ""; object.databaseInstanceId = ""; object.databaseId = ""; + object.encryptionConfig = null; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; @@ -55502,6 +55667,8 @@ object.databaseInstanceId = message.databaseInstanceId; if (message.databaseId != null && message.hasOwnProperty("databaseId")) object.databaseId = message.databaseId; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); return object; }; @@ -55796,6 +55963,7 @@ * @property {string|null} [databaseId] CreateCloudBackupAction databaseId * @property {google.protobuf.ITimestamp|null} [expireTime] CreateCloudBackupAction expireTime * @property {google.protobuf.ITimestamp|null} [versionTime] CreateCloudBackupAction versionTime + * @property {google.spanner.admin.database.v1.IEncryptionConfig|null} [encryptionConfig] CreateCloudBackupAction encryptionConfig */ /** @@ -55861,6 +56029,14 @@ */ CreateCloudBackupAction.prototype.versionTime = null; + /** + * CreateCloudBackupAction encryptionConfig. + * @member {google.spanner.admin.database.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.spanner.executor.v1.CreateCloudBackupAction + * @instance + */ + CreateCloudBackupAction.prototype.encryptionConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -55911,6 +56087,8 @@ $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -55969,6 +56147,10 @@ message.versionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 7: { + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -56030,6 +56212,11 @@ return "versionTime." + error; } } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } return null; }; @@ -56063,6 +56250,11 @@ throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.versionTime: object expected"); message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime); } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } return message; }; @@ -56085,6 +56277,7 @@ object.backupId = ""; object.databaseId = ""; object.expireTime = null; + object.encryptionConfig = null; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; @@ -56101,6 +56294,8 @@ if (options.oneofs) object._versionTime = "versionTime"; } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); return object; }; @@ -65512,6 +65707,417 @@ return HeartbeatRecord; })(); + v1.SpannerOptions = (function() { + + /** + * Properties of a SpannerOptions. + * @memberof google.spanner.executor.v1 + * @interface ISpannerOptions + * @property {google.spanner.executor.v1.ISessionPoolOptions|null} [sessionPoolOptions] SpannerOptions sessionPoolOptions + */ + + /** + * Constructs a new SpannerOptions. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SpannerOptions. + * @implements ISpannerOptions + * @constructor + * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set + */ + function SpannerOptions(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]]; + } + + /** + * SpannerOptions sessionPoolOptions. + * @member {google.spanner.executor.v1.ISessionPoolOptions|null|undefined} sessionPoolOptions + * @memberof google.spanner.executor.v1.SpannerOptions + * @instance + */ + SpannerOptions.prototype.sessionPoolOptions = null; + + /** + * Creates a new SpannerOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions instance + */ + SpannerOptions.create = function create(properties) { + return new SpannerOptions(properties); + }; + + /** + * Encodes the specified SpannerOptions message. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) + $root.google.spanner.executor.v1.SessionPoolOptions.encode(message.sessionPoolOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpannerOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SpannerOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.ISpannerOptions} message SpannerOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerOptions.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.executor.v1.SpannerOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerOptions message. + * @function verify + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) { + var error = $root.google.spanner.executor.v1.SessionPoolOptions.verify(message.sessionPoolOptions); + if (error) + return "sessionPoolOptions." + error; + } + return null; + }; + + /** + * Creates a SpannerOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SpannerOptions} SpannerOptions + */ + SpannerOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SpannerOptions) + return object; + var message = new $root.google.spanner.executor.v1.SpannerOptions(); + if (object.sessionPoolOptions != null) { + if (typeof object.sessionPoolOptions !== "object") + throw TypeError(".google.spanner.executor.v1.SpannerOptions.sessionPoolOptions: object expected"); + message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.fromObject(object.sessionPoolOptions); + } + return message; + }; + + /** + * Creates a plain object from a SpannerOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {google.spanner.executor.v1.SpannerOptions} message SpannerOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sessionPoolOptions = null; + if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) + object.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.toObject(message.sessionPoolOptions, options); + return object; + }; + + /** + * Converts this SpannerOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SpannerOptions + * @instance + * @returns {Object.} JSON object + */ + SpannerOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SpannerOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SpannerOptions"; + }; + + return SpannerOptions; + })(); + + v1.SessionPoolOptions = (function() { + + /** + * Properties of a SessionPoolOptions. + * @memberof google.spanner.executor.v1 + * @interface ISessionPoolOptions + * @property {boolean|null} [useMultiplexed] SessionPoolOptions useMultiplexed + */ + + /** + * Constructs a new SessionPoolOptions. + * @memberof google.spanner.executor.v1 + * @classdesc Represents a SessionPoolOptions. + * @implements ISessionPoolOptions + * @constructor + * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set + */ + function SessionPoolOptions(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]]; + } + + /** + * SessionPoolOptions useMultiplexed. + * @member {boolean} useMultiplexed + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @instance + */ + SessionPoolOptions.prototype.useMultiplexed = false; + + /** + * Creates a new SessionPoolOptions instance using the specified properties. + * @function create + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions=} [properties] Properties to set + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions instance + */ + SessionPoolOptions.create = function create(properties) { + return new SessionPoolOptions(properties); + }; + + /** + * Encodes the specified SessionPoolOptions message. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @function encode + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionPoolOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useMultiplexed); + return writer; + }; + + /** + * Encodes the specified SessionPoolOptions message, length delimited. Does not implicitly {@link google.spanner.executor.v1.SessionPoolOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.ISessionPoolOptions} message SessionPoolOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionPoolOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer. + * @function decode + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionPoolOptions.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.executor.v1.SessionPoolOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useMultiplexed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionPoolOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionPoolOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionPoolOptions message. + * @function verify + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionPoolOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + if (typeof message.useMultiplexed !== "boolean") + return "useMultiplexed: boolean expected"; + return null; + }; + + /** + * Creates a SessionPoolOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {Object.} object Plain object + * @returns {google.spanner.executor.v1.SessionPoolOptions} SessionPoolOptions + */ + SessionPoolOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.spanner.executor.v1.SessionPoolOptions) + return object; + var message = new $root.google.spanner.executor.v1.SessionPoolOptions(); + if (object.useMultiplexed != null) + message.useMultiplexed = Boolean(object.useMultiplexed); + return message; + }; + + /** + * Creates a plain object from a SessionPoolOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {google.spanner.executor.v1.SessionPoolOptions} message SessionPoolOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionPoolOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useMultiplexed = false; + if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + object.useMultiplexed = message.useMultiplexed; + return object; + }; + + /** + * Converts this SessionPoolOptions to JSON. + * @function toJSON + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @instance + * @returns {Object.} JSON object + */ + SessionPoolOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionPoolOptions + * @function getTypeUrl + * @memberof google.spanner.executor.v1.SessionPoolOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionPoolOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.spanner.executor.v1.SessionPoolOptions"; + }; + + return SessionPoolOptions; + })(); + return v1; })(); diff --git a/protos/protos.json b/protos/protos.json index caed224f6..2c8db5995 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -3205,6 +3205,13 @@ } } }, + "FulfillmentPeriod": { + "values": { + "FULFILLMENT_PERIOD_UNSPECIFIED": 0, + "FULFILLMENT_PERIOD_NORMAL": 1, + "FULFILLMENT_PERIOD_EXTENDED": 2 + } + }, "InstanceAdmin": { "options": { "(google.api.default_host)": "spanner.googleapis.com", @@ -4198,6 +4205,10 @@ "endTime": { "type": "google.protobuf.Timestamp", "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 } } }, @@ -4218,6 +4229,10 @@ "endTime": { "type": "google.protobuf.Timestamp", "id": 4 + }, + "expectedFulfillmentPeriod": { + "type": "FulfillmentPeriod", + "id": 5 } } }, @@ -4645,6 +4660,10 @@ "type": "string", "id": 1 }, + "spannerOptions": { + "type": "SpannerOptions", + "id": 2 + }, "start": { "type": "StartTransactionAction", "id": 10 @@ -5265,7 +5284,7 @@ "listCloudBackupOperations", "getOperation", "cancelOperation", - "reconfigureCloudDatabase" + "changeQuorumCloudDatabase" ] } }, @@ -5378,8 +5397,8 @@ "type": "CancelOperationAction", "id": 26 }, - "reconfigureCloudDatabase": { - "type": "ReconfigureCloudDatabaseAction", + "changeQuorumCloudDatabase": { + "type": "ChangeQuorumCloudDatabaseAction", "id": 28 } } @@ -5758,7 +5777,7 @@ } } }, - "ReconfigureCloudDatabaseAction": { + "ChangeQuorumCloudDatabaseAction": { "oneofs": { "_databaseUri": { "oneof": [ @@ -5904,6 +5923,10 @@ "databaseId": { "type": "string", "id": 5 + }, + "encryptionConfig": { + "type": "google.spanner.admin.database.v1.EncryptionConfig", + "id": 7 } } }, @@ -5961,6 +5984,10 @@ "options": { "proto3_optional": true } + }, + "encryptionConfig": { + "type": "google.spanner.admin.database.v1.EncryptionConfig", + "id": 7 } } }, @@ -6786,6 +6813,22 @@ "id": 1 } } + }, + "SpannerOptions": { + "fields": { + "sessionPoolOptions": { + "type": "SessionPoolOptions", + "id": 1 + } + } + }, + "SessionPoolOptions": { + "fields": { + "useMultiplexed": { + "type": "bool", + "id": 1 + } + } } } } diff --git a/src/v1/database_admin_client.ts b/src/v1/database_admin_client.ts index e2b95f901..a4e26200a 100644 --- a/src/v1/database_admin_client.ts +++ b/src/v1/database_admin_client.ts @@ -128,8 +128,15 @@ export class DatabaseAdminClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'spanner.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -181,7 +188,7 @@ export class DatabaseAdminClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -488,7 +495,7 @@ export class DatabaseAdminClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -506,7 +513,7 @@ export class DatabaseAdminClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/src/v1/instance_admin_client.ts b/src/v1/instance_admin_client.ts index 9036721e1..9f77a7c55 100644 --- a/src/v1/instance_admin_client.ts +++ b/src/v1/instance_admin_client.ts @@ -142,8 +142,15 @@ export class InstanceAdminClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'spanner.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -195,7 +202,7 @@ export class InstanceAdminClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -492,7 +499,7 @@ export class InstanceAdminClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -510,7 +517,7 @@ export class InstanceAdminClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/src/v1/spanner_client.ts b/src/v1/spanner_client.ts index a43e9460d..910433c5c 100644 --- a/src/v1/spanner_client.ts +++ b/src/v1/spanner_client.ts @@ -122,8 +122,15 @@ export class SpannerClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'spanner.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -175,7 +182,7 @@ export class SpannerClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -352,7 +359,7 @@ export class SpannerClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -370,7 +377,7 @@ export class SpannerClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/src/v1/spanner_executor_proxy_client.ts b/src/v1/spanner_executor_proxy_client.ts index 96c8c7c57..578d53b43 100644 --- a/src/v1/spanner_executor_proxy_client.ts +++ b/src/v1/spanner_executor_proxy_client.ts @@ -117,8 +117,15 @@ export class SpannerExecutorProxyClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'spanner-cloud-executor.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -167,7 +174,7 @@ export class SpannerExecutorProxyClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -318,7 +325,7 @@ export class SpannerExecutorProxyClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -336,7 +343,7 @@ export class SpannerExecutorProxyClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/test/gapic_database_admin_v1.ts b/test/gapic_database_admin_v1.ts index cc1c4d8e5..44bf738ce 100644 --- a/test/gapic_database_admin_v1.ts +++ b/test/gapic_database_admin_v1.ts @@ -174,7 +174,7 @@ describe('v1.DatabaseAdminClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -210,6 +210,38 @@ describe('v1.DatabaseAdminClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'spanner.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new databaseadminModule.v1.DatabaseAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new databaseadminModule.v1.DatabaseAdminClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new databaseadminModule.v1.DatabaseAdminClient({ diff --git a/test/gapic_instance_admin_v1.ts b/test/gapic_instance_admin_v1.ts index 9cf1f57a5..06acd0e1f 100644 --- a/test/gapic_instance_admin_v1.ts +++ b/test/gapic_instance_admin_v1.ts @@ -174,7 +174,7 @@ describe('v1.InstanceAdminClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -210,6 +210,38 @@ describe('v1.InstanceAdminClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'spanner.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new instanceadminModule.v1.InstanceAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new instanceadminModule.v1.InstanceAdminClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new instanceadminModule.v1.InstanceAdminClient({ diff --git a/test/gapic_spanner_executor_proxy_v1.ts b/test/gapic_spanner_executor_proxy_v1.ts index 49488f6cc..8d37af969 100644 --- a/test/gapic_spanner_executor_proxy_v1.ts +++ b/test/gapic_spanner_executor_proxy_v1.ts @@ -82,7 +82,7 @@ describe('v1.SpannerExecutorProxyClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -126,6 +126,43 @@ describe('v1.SpannerExecutorProxyClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner-cloud-executor.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'spanner-cloud-executor.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new spannerexecutorproxyModule.v1.SpannerExecutorProxyClient({ diff --git a/test/gapic_spanner_v1.ts b/test/gapic_spanner_v1.ts index a8da50a21..42be02ff5 100644 --- a/test/gapic_spanner_v1.ts +++ b/test/gapic_spanner_v1.ts @@ -163,7 +163,7 @@ describe('v1.SpannerClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -197,6 +197,38 @@ describe('v1.SpannerClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'spanner.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerModule.v1.SpannerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new spannerModule.v1.SpannerClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'spanner.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new spannerModule.v1.SpannerClient({ From dacf8697b20752041684710982035b4c97837d28 Mon Sep 17 00:00:00 2001 From: alkatrivedi <58396306+alkatrivedi@users.noreply.github.com> Date: Wed, 17 Apr 2024 06:08:57 +0000 Subject: [PATCH 3/4] feat: optimisticLock option for getTransaction method (#2028) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add option for optimistic lock in getTransaction method * feat: add option for optimistic lock in getTransaction method * add sample for read and write transaction * add sample for read and write transaction * chore: add integration test for the read/write query samples * fix: presubmit error * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: presubmit error * refactor: sample doc * refactor: sample doc * refator: getTransaction method * fix: lint errors * fix: lint errors * refactor: remove logs * fix: presubmit error * fix: lint errors * test: add a unit test for getTransaction * tests: add integration and unit test for getTransaction options properties * fix: lint errors * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * refactor: naming convention for varaible in getTransaction method * refactor: naming convention for varaible in getTransaction method * fix: lint errors * fix: lint error --------- Co-authored-by: Owl Bot --- .gitignore | 1 + src/database.ts | 31 +++++++++++++++++++++++++++++-- system-test/spanner.ts | 18 ++++++++++++++++++ test/spanner.ts | 23 +++++++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d4f03a0df..14050d4e4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ +.vscode \ No newline at end of file diff --git a/src/database.ts b/src/database.ts index 970e6d8c2..c35f1557e 100644 --- a/src/database.ts +++ b/src/database.ts @@ -224,6 +224,13 @@ export interface GetIamPolicyOptions { gaxOptions?: CallOptions; } +/** + * @typedef {object} GetTransactionOptions + * * @property {boolean} [optimisticLock] The optimistic lock a + * {@link Transaction} should use while running. + */ +export type GetTransactionOptions = Omit; + export type CreateSessionCallback = ResourceCallback< Session, spannerClient.spanner.v1.ISession @@ -1989,16 +1996,36 @@ class Database extends common.GrpcServiceObject { * }); * ``` */ - getTransaction(): Promise<[Transaction]>; + getTransaction( + optionsOrCallback?: GetTransactionOptions + ): Promise<[Transaction]>; getTransaction(callback: GetTransactionCallback): void; getTransaction( + optionsOrCallback?: GetTransactionOptions | GetTransactionCallback, callback?: GetTransactionCallback ): void | Promise<[Transaction]> { + const cb = + typeof optionsOrCallback === 'function' + ? (optionsOrCallback as GetTransactionCallback) + : callback; + const options = + typeof optionsOrCallback === 'object' && optionsOrCallback + ? (optionsOrCallback as GetTransactionOptions) + : {}; this.pool_.getSession((err, session, transaction) => { + if (options.requestOptions) { + transaction!.requestOptions = Object.assign( + transaction!.requestOptions || {}, + options.requestOptions + ); + } + if (options.optimisticLock) { + transaction!.useOptimisticLock(); + } if (!err) { this._releaseOnEnd(session!, transaction!); } - callback!(err as grpc.ServiceError | null, transaction); + cb!(err as grpc.ServiceError | null, transaction); }); } diff --git a/system-test/spanner.ts b/system-test/spanner.ts index 8849f6e2b..041920a77 100644 --- a/system-test/spanner.ts +++ b/system-test/spanner.ts @@ -8894,6 +8894,24 @@ describe('Spanner', () => { mismatchedColumnError(done, DATABASE, googleSqlTable); }); + it('GOOGLE_STANDARD_SQL should use getTransaction for executing sql', async () => { + const transaction = ( + await DATABASE.getTransaction({optimisticLock: true}) + )[0]; + + try { + const [rows] = await transaction!.run('SELECT * FROM TxnTable'); + assert.strictEqual(rows.length, googleSqlRecords.length); + } catch (err) { + // flaky failures are acceptable here as long as the error is not due to a lock conflict + if ((err as grpc.ServiceError).code === grpc.status.ABORTED) { + assert.ok(err, 'Transaction is aborted'); + } + } finally { + transaction.end(); + } + }); + it('POSTGRESQL should throw an error for mismatched columns', function (done) { if (IS_EMULATOR_ENABLED) { this.skip(); diff --git a/test/spanner.ts b/test/spanner.ts index 38f1105d3..293b8bbd2 100644 --- a/test/spanner.ts +++ b/test/spanner.ts @@ -3286,6 +3286,29 @@ describe('Spanner with mock server', () => { }); }); + it('should use optimistic lock and transaction tag for getTransaction', async () => { + const database = newTestDatabase(); + const promise = await database.getTransaction({ + optimisticLock: true, + requestOptions: {transactionTag: 'transaction-tag'}, + }); + const transaction = promise[0]; + await transaction.run('SELECT 1').then(results => { + const request = spannerMock.getRequests().find(val => { + return (val as v1.ExecuteSqlRequest).sql; + }) as v1.ExecuteSqlRequest; + assert.ok(request, 'no ExecuteSqlRequest found'); + assert.strictEqual( + request.transaction!.begin!.readWrite!.readLockMode, + 'OPTIMISTIC' + ); + assert.strictEqual( + request.requestOptions?.transactionTag, + 'transaction-tag' + ); + }); + }); + it('should reuse a session for optimistic and pessimistic locks', async () => { const database = newTestDatabase({min: 1, max: 1}); let session1; From 8e51a08d4ca595e52be9bcbb871e3e2195dd0960 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:43:51 +0530 Subject: [PATCH 4/4] chore(main): release 7.7.0 (#2027) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 105ac3b91..b9c7d82c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions +## [7.7.0](https://github.com/googleapis/nodejs-spanner/compare/v7.6.0...v7.7.0) (2024-04-17) + + +### Features + +* OptimisticLock option for getTransaction method ([#2028](https://github.com/googleapis/nodejs-spanner/issues/2028)) ([dacf869](https://github.com/googleapis/nodejs-spanner/commit/dacf8697b20752041684710982035b4c97837d28)) +* **spanner:** Adding `EXPECTED_FULFILLMENT_PERIOD` to the indicate instance creation times (with `FULFILLMENT_PERIOD_NORMAL` or `FULFILLMENT_PERIOD_EXTENDED` ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature ([#2024](https://github.com/googleapis/nodejs-spanner/issues/2024)) ([5292e03](https://github.com/googleapis/nodejs-spanner/commit/5292e035c5278ba6806f9e1eb84809ed893b1e37)) + + +### Bug Fixes + +* **deps:** Update dependency google-gax to v4.3.2 ([#2026](https://github.com/googleapis/nodejs-spanner/issues/2026)) ([0ee9831](https://github.com/googleapis/nodejs-spanner/commit/0ee98319f291f552a0afc52629d12af9969d1d10)) + ## [7.6.0](https://github.com/googleapis/nodejs-spanner/compare/v7.5.0...v7.6.0) (2024-03-26) diff --git a/package.json b/package.json index 89b2ebce8..8b8cdca08 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.6.0", + "version": "7.7.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/samples/package.json b/samples/package.json index e8464b979..ea6e99d57 100644 --- a/samples/package.json +++ b/samples/package.json @@ -17,7 +17,7 @@ "dependencies": { "@google-cloud/kms": "^4.0.0", "@google-cloud/precise-date": "^4.0.0", - "@google-cloud/spanner": "^7.6.0", + "@google-cloud/spanner": "^7.7.0", "yargs": "^17.0.0" }, "devDependencies": {