@google-cloud/spanner 7.6.0 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +4 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +190 -109
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +30 -10
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +166 -100
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +15 -1
  7. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +6 -0
  8. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +30 -6
  9. package/build/protos/google/spanner/v1/commit_response.proto +1 -1
  10. package/build/protos/google/spanner/v1/keys.proto +1 -1
  11. package/build/protos/google/spanner/v1/mutation.proto +1 -1
  12. package/build/protos/google/spanner/v1/query_plan.proto +1 -1
  13. package/build/protos/google/spanner/v1/result_set.proto +1 -1
  14. package/build/protos/google/spanner/v1/spanner.proto +1 -1
  15. package/build/protos/google/spanner/v1/transaction.proto +1 -1
  16. package/build/protos/google/spanner/v1/type.proto +1 -1
  17. package/build/protos/protos.d.ts +310 -40
  18. package/build/protos/protos.js +942 -89
  19. package/build/protos/protos.json +115 -5
  20. package/build/src/codec.d.ts +56 -1
  21. package/build/src/codec.js +109 -4
  22. package/build/src/database.d.ts +41 -5
  23. package/build/src/database.js +37 -2
  24. package/build/src/index.d.ts +50 -1
  25. package/build/src/index.js +53 -0
  26. package/build/src/partial-result-stream.d.ts +41 -0
  27. package/build/src/partial-result-stream.js +6 -1
  28. package/build/src/table.d.ts +1 -0
  29. package/build/src/table.js +36 -2
  30. package/build/src/transaction-runner.d.ts +1 -0
  31. package/build/src/transaction-runner.js +3 -0
  32. package/build/src/transaction.d.ts +55 -0
  33. package/build/src/transaction.js +28 -2
  34. package/build/src/v1/database_admin_client.d.ts +175 -126
  35. package/build/src/v1/database_admin_client.js +95 -64
  36. package/build/src/v1/instance_admin_client.js +10 -7
  37. package/build/src/v1/spanner_client.js +10 -7
  38. package/build/src/v1/spanner_client_config.json +15 -14
  39. package/build/src/v1/spanner_executor_proxy_client.js +10 -7
  40. package/package.json +3 -3
@@ -32,7 +32,7 @@ const version = require('../../../package.json').version;
32
32
  * The Cloud Spanner Database Admin API can be used to:
33
33
  * * create, drop, and list databases
34
34
  * * update the schema of pre-existing databases
35
- * * create, delete and list backups for a database
35
+ * * create, delete, copy and list backups for a database
36
36
  * * restore a database from an existing backup
37
37
  * @class
38
38
  * @memberof v1
@@ -78,7 +78,7 @@ class DatabaseAdminClient {
78
78
  * ```
79
79
  */
80
80
  constructor(opts, gaxInstance) {
81
- var _a, _b, _c, _d;
81
+ var _a, _b, _c, _d, _e;
82
82
  this._terminated = false;
83
83
  this.descriptors = {
84
84
  page: {},
@@ -93,14 +93,17 @@ class DatabaseAdminClient {
93
93
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
94
94
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
95
95
  }
96
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
97
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
98
+ : undefined;
96
99
  this._universeDomain =
97
- (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
100
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
98
101
  this._servicePath = 'spanner.' + this._universeDomain;
99
102
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
100
103
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
101
104
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
102
- const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
103
- const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
105
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
106
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
104
107
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
105
108
  // Request numeric enum values if REST transport is used.
106
109
  opts.numericEnums = true;
@@ -130,7 +133,7 @@ class DatabaseAdminClient {
130
133
  }
131
134
  // Determine the client header string.
132
135
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
133
- if (typeof process !== 'undefined' && 'versions' in process) {
136
+ if (typeof process === 'object' && 'versions' in process) {
134
137
  clientHeader.push(`gl-node/${process.versions.node}`);
135
138
  }
136
139
  else {
@@ -324,7 +327,7 @@ class DatabaseAdminClient {
324
327
  * @returns {string} The DNS address for this service.
325
328
  */
326
329
  static get servicePath() {
327
- if (typeof process !== undefined &&
330
+ if (typeof process === 'object' &&
328
331
  typeof process.emitWarning === 'function') {
329
332
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
330
333
  }
@@ -336,7 +339,7 @@ class DatabaseAdminClient {
336
339
  * @returns {string} The DNS address for this service.
337
340
  */
338
341
  static get apiEndpoint() {
339
- if (typeof process !== undefined &&
342
+ if (typeof process === 'object' &&
340
343
  typeof process.emitWarning === 'function') {
341
344
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
342
345
  }
@@ -819,8 +822,9 @@ class DatabaseAdminClient {
819
822
  * defaults to the server's maximum allowed page size.
820
823
  * @param {string} request.pageToken
821
824
  * If non-empty, `page_token` should contain a
822
- * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a
823
- * previous {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
825
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token}
826
+ * from a previous
827
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
824
828
  * @param {object} [options]
825
829
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
826
830
  * @returns {Stream}
@@ -861,8 +865,9 @@ class DatabaseAdminClient {
861
865
  * defaults to the server's maximum allowed page size.
862
866
  * @param {string} request.pageToken
863
867
  * If non-empty, `page_token` should contain a
864
- * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a
865
- * previous {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
868
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token}
869
+ * from a previous
870
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
866
871
  * @param {object} [options]
867
872
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
868
873
  * @returns {Object}
@@ -925,7 +930,9 @@ class DatabaseAdminClient {
925
930
  * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
926
931
  * Colon `:` is the contains operator. Filter rules are not case sensitive.
927
932
  *
928
- * The following fields in the {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering:
933
+ * The following fields in the
934
+ * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for
935
+ * filtering:
929
936
  *
930
937
  * * `name`
931
938
  * * `database`
@@ -957,9 +964,10 @@ class DatabaseAdminClient {
957
964
  * less, defaults to the server's maximum allowed page size.
958
965
  * @param {string} request.pageToken
959
966
  * If non-empty, `page_token` should contain a
960
- * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a
961
- * previous {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same
962
- * `filter`.
967
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token}
968
+ * from a previous
969
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse}
970
+ * to the same `parent` and with the same `filter`.
963
971
  * @param {object} [options]
964
972
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
965
973
  * @returns {Stream}
@@ -1004,7 +1012,9 @@ class DatabaseAdminClient {
1004
1012
  * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1005
1013
  * Colon `:` is the contains operator. Filter rules are not case sensitive.
1006
1014
  *
1007
- * The following fields in the {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering:
1015
+ * The following fields in the
1016
+ * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for
1017
+ * filtering:
1008
1018
  *
1009
1019
  * * `name`
1010
1020
  * * `database`
@@ -1036,9 +1046,10 @@ class DatabaseAdminClient {
1036
1046
  * less, defaults to the server's maximum allowed page size.
1037
1047
  * @param {string} request.pageToken
1038
1048
  * If non-empty, `page_token` should contain a
1039
- * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a
1040
- * previous {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same
1041
- * `filter`.
1049
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token}
1050
+ * from a previous
1051
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse}
1052
+ * to the same `parent` and with the same `filter`.
1042
1053
  * @param {object} [options]
1043
1054
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1044
1055
  * @returns {Object}
@@ -1107,7 +1118,9 @@ class DatabaseAdminClient {
1107
1118
  * * `name` - The name of the long-running operation
1108
1119
  * * `done` - False if the operation is in progress, else true.
1109
1120
  * * `metadata.@type` - the type of metadata. For example, the type string
1110
- * for {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
1121
+ * for
1122
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}
1123
+ * is
1111
1124
  * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1112
1125
  * * `metadata.<field_name>` - any field in metadata.value.
1113
1126
  * `metadata.@type` must be specified first, if filtering on metadata
@@ -1129,7 +1142,8 @@ class DatabaseAdminClient {
1129
1142
  * `(metadata.name:restored_howl) AND` \
1130
1143
  * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1131
1144
  * `(error:*)` - Return operations where:
1132
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1145
+ * * The operation's metadata type is
1146
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1133
1147
  * * The database is restored from a backup.
1134
1148
  * * The backup name contains "backup_howl".
1135
1149
  * * The restored database's name contains "restored_howl".
@@ -1141,8 +1155,9 @@ class DatabaseAdminClient {
1141
1155
  * @param {string} request.pageToken
1142
1156
  * If non-empty, `page_token` should contain a
1143
1157
  * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
1144
- * from a previous {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the
1145
- * same `parent` and with the same `filter`.
1158
+ * from a previous
1159
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse}
1160
+ * to the same `parent` and with the same `filter`.
1146
1161
  * @param {object} [options]
1147
1162
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1148
1163
  * @returns {Stream}
@@ -1193,7 +1208,9 @@ class DatabaseAdminClient {
1193
1208
  * * `name` - The name of the long-running operation
1194
1209
  * * `done` - False if the operation is in progress, else true.
1195
1210
  * * `metadata.@type` - the type of metadata. For example, the type string
1196
- * for {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
1211
+ * for
1212
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}
1213
+ * is
1197
1214
  * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1198
1215
  * * `metadata.<field_name>` - any field in metadata.value.
1199
1216
  * `metadata.@type` must be specified first, if filtering on metadata
@@ -1215,7 +1232,8 @@ class DatabaseAdminClient {
1215
1232
  * `(metadata.name:restored_howl) AND` \
1216
1233
  * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1217
1234
  * `(error:*)` - Return operations where:
1218
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1235
+ * * The operation's metadata type is
1236
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1219
1237
  * * The database is restored from a backup.
1220
1238
  * * The backup name contains "backup_howl".
1221
1239
  * * The restored database's name contains "restored_howl".
@@ -1227,8 +1245,9 @@ class DatabaseAdminClient {
1227
1245
  * @param {string} request.pageToken
1228
1246
  * If non-empty, `page_token` should contain a
1229
1247
  * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
1230
- * from a previous {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the
1231
- * same `parent` and with the same `filter`.
1248
+ * from a previous
1249
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse}
1250
+ * to the same `parent` and with the same `filter`.
1232
1251
  * @param {object} [options]
1233
1252
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1234
1253
  * @returns {Object}
@@ -1297,7 +1316,9 @@ class DatabaseAdminClient {
1297
1316
  * * `name` - The name of the long-running operation
1298
1317
  * * `done` - False if the operation is in progress, else true.
1299
1318
  * * `metadata.@type` - the type of metadata. For example, the type string
1300
- * for {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
1319
+ * for
1320
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1321
+ * is
1301
1322
  * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1302
1323
  * * `metadata.<field_name>` - any field in metadata.value.
1303
1324
  * `metadata.@type` must be specified first if filtering on metadata
@@ -1315,14 +1336,15 @@ class DatabaseAdminClient {
1315
1336
  * * `done:true` - The operation is complete.
1316
1337
  * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1317
1338
  * `metadata.database:prod` - Returns operations where:
1318
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1319
- * * The database the backup was taken from has a name containing the
1320
- * string "prod".
1339
+ * * The operation's metadata type is
1340
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1341
+ * * The source database name of backup contains the string "prod".
1321
1342
  * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1322
1343
  * `(metadata.name:howl) AND` \
1323
1344
  * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1324
1345
  * `(error:*)` - Returns operations where:
1325
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1346
+ * * The operation's metadata type is
1347
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1326
1348
  * * The backup name contains the string "howl".
1327
1349
  * * The operation started before 2018-03-28T14:50:00Z.
1328
1350
  * * The operation resulted in an error.
@@ -1330,9 +1352,9 @@ class DatabaseAdminClient {
1330
1352
  * `(metadata.source_backup:test) AND` \
1331
1353
  * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
1332
1354
  * `(error:*)` - Returns operations where:
1333
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1334
- * * The source backup of the copied backup name contains the string
1335
- * "test".
1355
+ * * The operation's metadata type is
1356
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1357
+ * * The source backup name contains the string "test".
1336
1358
  * * The operation started before 2022-01-18T14:50:00Z.
1337
1359
  * * The operation resulted in an error.
1338
1360
  * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
@@ -1342,12 +1364,13 @@ class DatabaseAdminClient {
1342
1364
  * `(metadata.source_backup:test_bkp)) AND` \
1343
1365
  * `(error:*)` - Returns operations where:
1344
1366
  * * The operation's metadata matches either of criteria:
1345
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the
1346
- * database the backup was taken from has name containing string
1367
+ * * The operation's metadata type is
1368
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1369
+ * AND the source database name of the backup contains the string
1347
1370
  * "test_db"
1348
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the
1349
- * backup the backup was copied from has name containing string
1350
- * "test_bkp"
1371
+ * * The operation's metadata type is
1372
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}
1373
+ * AND the source backup name contains the string "test_bkp"
1351
1374
  * * The operation resulted in an error.
1352
1375
  * @param {number} request.pageSize
1353
1376
  * Number of operations to be returned in the response. If 0 or
@@ -1355,8 +1378,9 @@ class DatabaseAdminClient {
1355
1378
  * @param {string} request.pageToken
1356
1379
  * If non-empty, `page_token` should contain a
1357
1380
  * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
1358
- * from a previous {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the
1359
- * same `parent` and with the same `filter`.
1381
+ * from a previous
1382
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse}
1383
+ * to the same `parent` and with the same `filter`.
1360
1384
  * @param {object} [options]
1361
1385
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1362
1386
  * @returns {Stream}
@@ -1407,7 +1431,9 @@ class DatabaseAdminClient {
1407
1431
  * * `name` - The name of the long-running operation
1408
1432
  * * `done` - False if the operation is in progress, else true.
1409
1433
  * * `metadata.@type` - the type of metadata. For example, the type string
1410
- * for {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
1434
+ * for
1435
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1436
+ * is
1411
1437
  * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1412
1438
  * * `metadata.<field_name>` - any field in metadata.value.
1413
1439
  * `metadata.@type` must be specified first if filtering on metadata
@@ -1425,14 +1451,15 @@ class DatabaseAdminClient {
1425
1451
  * * `done:true` - The operation is complete.
1426
1452
  * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1427
1453
  * `metadata.database:prod` - Returns operations where:
1428
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1429
- * * The database the backup was taken from has a name containing the
1430
- * string "prod".
1454
+ * * The operation's metadata type is
1455
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1456
+ * * The source database name of backup contains the string "prod".
1431
1457
  * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1432
1458
  * `(metadata.name:howl) AND` \
1433
1459
  * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1434
1460
  * `(error:*)` - Returns operations where:
1435
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1461
+ * * The operation's metadata type is
1462
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1436
1463
  * * The backup name contains the string "howl".
1437
1464
  * * The operation started before 2018-03-28T14:50:00Z.
1438
1465
  * * The operation resulted in an error.
@@ -1440,9 +1467,9 @@ class DatabaseAdminClient {
1440
1467
  * `(metadata.source_backup:test) AND` \
1441
1468
  * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
1442
1469
  * `(error:*)` - Returns operations where:
1443
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1444
- * * The source backup of the copied backup name contains the string
1445
- * "test".
1470
+ * * The operation's metadata type is
1471
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1472
+ * * The source backup name contains the string "test".
1446
1473
  * * The operation started before 2022-01-18T14:50:00Z.
1447
1474
  * * The operation resulted in an error.
1448
1475
  * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
@@ -1452,12 +1479,13 @@ class DatabaseAdminClient {
1452
1479
  * `(metadata.source_backup:test_bkp)) AND` \
1453
1480
  * `(error:*)` - Returns operations where:
1454
1481
  * * The operation's metadata matches either of criteria:
1455
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the
1456
- * database the backup was taken from has name containing string
1482
+ * * The operation's metadata type is
1483
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1484
+ * AND the source database name of the backup contains the string
1457
1485
  * "test_db"
1458
- * * The operation's metadata type is {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the
1459
- * backup the backup was copied from has name containing string
1460
- * "test_bkp"
1486
+ * * The operation's metadata type is
1487
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}
1488
+ * AND the source backup name contains the string "test_bkp"
1461
1489
  * * The operation resulted in an error.
1462
1490
  * @param {number} request.pageSize
1463
1491
  * Number of operations to be returned in the response. If 0 or
@@ -1465,8 +1493,9 @@ class DatabaseAdminClient {
1465
1493
  * @param {string} request.pageToken
1466
1494
  * If non-empty, `page_token` should contain a
1467
1495
  * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
1468
- * from a previous {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the
1469
- * same `parent` and with the same `filter`.
1496
+ * from a previous
1497
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse}
1498
+ * to the same `parent` and with the same `filter`.
1470
1499
  * @param {object} [options]
1471
1500
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1472
1501
  * @returns {Object}
@@ -1520,14 +1549,15 @@ class DatabaseAdminClient {
1520
1549
  * @param {string} request.parent
1521
1550
  * Required. The database whose roles should be listed.
1522
1551
  * Values are of the form
1523
- * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1552
+ * `projects/<project>/instances/<instance>/databases/<database>`.
1524
1553
  * @param {number} request.pageSize
1525
1554
  * Number of database roles to be returned in the response. If 0 or less,
1526
1555
  * defaults to the server's maximum allowed page size.
1527
1556
  * @param {string} request.pageToken
1528
1557
  * If non-empty, `page_token` should contain a
1529
- * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
1530
- * previous {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1558
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token}
1559
+ * from a previous
1560
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1531
1561
  * @param {object} [options]
1532
1562
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1533
1563
  * @returns {Stream}
@@ -1563,14 +1593,15 @@ class DatabaseAdminClient {
1563
1593
  * @param {string} request.parent
1564
1594
  * Required. The database whose roles should be listed.
1565
1595
  * Values are of the form
1566
- * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1596
+ * `projects/<project>/instances/<instance>/databases/<database>`.
1567
1597
  * @param {number} request.pageSize
1568
1598
  * Number of database roles to be returned in the response. If 0 or less,
1569
1599
  * defaults to the server's maximum allowed page size.
1570
1600
  * @param {string} request.pageToken
1571
1601
  * If non-empty, `page_token` should contain a
1572
- * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
1573
- * previous {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1602
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token}
1603
+ * from a previous
1604
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1574
1605
  * @param {object} [options]
1575
1606
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1576
1607
  * @returns {Object}
@@ -92,7 +92,7 @@ class InstanceAdminClient {
92
92
  * ```
93
93
  */
94
94
  constructor(opts, gaxInstance) {
95
- var _a, _b, _c, _d;
95
+ var _a, _b, _c, _d, _e;
96
96
  this._terminated = false;
97
97
  this.descriptors = {
98
98
  page: {},
@@ -107,14 +107,17 @@ class InstanceAdminClient {
107
107
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
108
108
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
109
109
  }
110
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
111
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
112
+ : undefined;
110
113
  this._universeDomain =
111
- (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
114
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
112
115
  this._servicePath = 'spanner.' + this._universeDomain;
113
116
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
114
117
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
115
118
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
116
- const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
117
- const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
119
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
120
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
118
121
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
119
122
  // Request numeric enum values if REST transport is used.
120
123
  opts.numericEnums = true;
@@ -144,7 +147,7 @@ class InstanceAdminClient {
144
147
  }
145
148
  // Determine the client header string.
146
149
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
147
- if (typeof process !== 'undefined' && 'versions' in process) {
150
+ if (typeof process === 'object' && 'versions' in process) {
148
151
  clientHeader.push(`gl-node/${process.versions.node}`);
149
152
  }
150
153
  else {
@@ -323,7 +326,7 @@ class InstanceAdminClient {
323
326
  * @returns {string} The DNS address for this service.
324
327
  */
325
328
  static get servicePath() {
326
- if (typeof process !== undefined &&
329
+ if (typeof process === 'object' &&
327
330
  typeof process.emitWarning === 'function') {
328
331
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
329
332
  }
@@ -335,7 +338,7 @@ class InstanceAdminClient {
335
338
  * @returns {string} The DNS address for this service.
336
339
  */
337
340
  static get apiEndpoint() {
338
- if (typeof process !== undefined &&
341
+ if (typeof process === 'object' &&
339
342
  typeof process.emitWarning === 'function') {
340
343
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
341
344
  }
@@ -76,7 +76,7 @@ class SpannerClient {
76
76
  * ```
77
77
  */
78
78
  constructor(opts, gaxInstance) {
79
- var _a, _b, _c, _d;
79
+ var _a, _b, _c, _d, _e;
80
80
  this._terminated = false;
81
81
  this.descriptors = {
82
82
  page: {},
@@ -91,14 +91,17 @@ class SpannerClient {
91
91
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
92
92
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
93
93
  }
94
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
95
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
96
+ : undefined;
94
97
  this._universeDomain =
95
- (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
98
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
96
99
  this._servicePath = 'spanner.' + this._universeDomain;
97
100
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
98
101
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
99
102
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
100
- const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
101
- const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
103
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
104
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
102
105
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
103
106
  // Request numeric enum values if REST transport is used.
104
107
  opts.numericEnums = true;
@@ -128,7 +131,7 @@ class SpannerClient {
128
131
  }
129
132
  // Determine the client header string.
130
133
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
131
- if (typeof process !== 'undefined' && 'versions' in process) {
134
+ if (typeof process === 'object' && 'versions' in process) {
132
135
  clientHeader.push(`gl-node/${process.versions.node}`);
133
136
  }
134
137
  else {
@@ -250,7 +253,7 @@ class SpannerClient {
250
253
  * @returns {string} The DNS address for this service.
251
254
  */
252
255
  static get servicePath() {
253
- if (typeof process !== undefined &&
256
+ if (typeof process === 'object' &&
254
257
  typeof process.emitWarning === 'function') {
255
258
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
256
259
  }
@@ -262,7 +265,7 @@ class SpannerClient {
262
265
  * @returns {string} The DNS address for this service.
263
266
  */
264
267
  static get apiEndpoint() {
265
- if (typeof process !== undefined &&
268
+ if (typeof process === 'object' &&
266
269
  typeof process.emitWarning === 'function') {
267
270
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
268
271
  }
@@ -7,7 +7,8 @@
7
7
  "DEADLINE_EXCEEDED",
8
8
  "UNAVAILABLE"
9
9
  ],
10
- "unavailable": [
10
+ "resource_exhausted_unavailable": [
11
+ "RESOURCE_EXHAUSTED",
11
12
  "UNAVAILABLE"
12
13
  ]
13
14
  },
@@ -34,32 +35,32 @@
34
35
  "methods": {
35
36
  "CreateSession": {
36
37
  "timeout_millis": 30000,
37
- "retry_codes_name": "unavailable",
38
+ "retry_codes_name": "resource_exhausted_unavailable",
38
39
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
39
40
  },
40
41
  "BatchCreateSessions": {
41
42
  "timeout_millis": 60000,
42
- "retry_codes_name": "unavailable",
43
+ "retry_codes_name": "resource_exhausted_unavailable",
43
44
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
44
45
  },
45
46
  "GetSession": {
46
47
  "timeout_millis": 30000,
47
- "retry_codes_name": "unavailable",
48
+ "retry_codes_name": "resource_exhausted_unavailable",
48
49
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
49
50
  },
50
51
  "ListSessions": {
51
52
  "timeout_millis": 3600000,
52
- "retry_codes_name": "unavailable",
53
+ "retry_codes_name": "resource_exhausted_unavailable",
53
54
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
54
55
  },
55
56
  "DeleteSession": {
56
57
  "timeout_millis": 30000,
57
- "retry_codes_name": "unavailable",
58
+ "retry_codes_name": "resource_exhausted_unavailable",
58
59
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
59
60
  },
60
61
  "ExecuteSql": {
61
62
  "timeout_millis": 30000,
62
- "retry_codes_name": "unavailable",
63
+ "retry_codes_name": "resource_exhausted_unavailable",
63
64
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
64
65
  },
65
66
  "ExecuteStreamingSql": {
@@ -69,12 +70,12 @@
69
70
  },
70
71
  "ExecuteBatchDml": {
71
72
  "timeout_millis": 30000,
72
- "retry_codes_name": "unavailable",
73
+ "retry_codes_name": "resource_exhausted_unavailable",
73
74
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
74
75
  },
75
76
  "Read": {
76
77
  "timeout_millis": 30000,
77
- "retry_codes_name": "unavailable",
78
+ "retry_codes_name": "resource_exhausted_unavailable",
78
79
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
79
80
  },
80
81
  "StreamingRead": {
@@ -84,27 +85,27 @@
84
85
  },
85
86
  "BeginTransaction": {
86
87
  "timeout_millis": 30000,
87
- "retry_codes_name": "unavailable",
88
+ "retry_codes_name": "resource_exhausted_unavailable",
88
89
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
89
90
  },
90
91
  "Commit": {
91
92
  "timeout_millis": 3600000,
92
- "retry_codes_name": "unavailable",
93
+ "retry_codes_name": "resource_exhausted_unavailable",
93
94
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
94
95
  },
95
96
  "Rollback": {
96
97
  "timeout_millis": 30000,
97
- "retry_codes_name": "unavailable",
98
+ "retry_codes_name": "resource_exhausted_unavailable",
98
99
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
99
100
  },
100
101
  "PartitionQuery": {
101
102
  "timeout_millis": 30000,
102
- "retry_codes_name": "unavailable",
103
+ "retry_codes_name": "resource_exhausted_unavailable",
103
104
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
104
105
  },
105
106
  "PartitionRead": {
106
107
  "timeout_millis": 30000,
107
- "retry_codes_name": "unavailable",
108
+ "retry_codes_name": "resource_exhausted_unavailable",
108
109
  "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45"
109
110
  },
110
111
  "BatchWrite": {