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({