@google-cloud/spanner 6.1.1 → 6.1.4

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.
@@ -137,6 +137,7 @@ class DatabaseAdminClient {
137
137
  backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
138
138
  cryptoKeyPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'),
139
139
  databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
140
+ databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
140
141
  instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
141
142
  };
142
143
  // Some of the methods on this service return "paged" results,
@@ -147,6 +148,7 @@ class DatabaseAdminClient {
147
148
  listBackups: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'),
148
149
  listDatabaseOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
149
150
  listBackupOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
151
+ listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
150
152
  };
151
153
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
152
154
  // This API contains "long-running operations", which return a
@@ -160,31 +162,45 @@ class DatabaseAdminClient {
160
162
  lroOptions.protoJson = protoFilesRoot;
161
163
  lroOptions.httpRules = [
162
164
  {
163
- selector: 'google.longrunning.Operations.GetOperation',
164
- get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
165
+ selector: 'google.longrunning.Operations.CancelOperation',
166
+ post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
165
167
  additional_bindings: [
166
- { get: '/v1/{name=projects/*/instances/*/operations/*}' },
168
+ { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
169
+ {
170
+ post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',
171
+ },
172
+ {
173
+ post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',
174
+ },
167
175
  ],
168
176
  },
169
177
  {
170
- selector: 'google.longrunning.Operations.ListOperations',
171
- get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
178
+ selector: 'google.longrunning.Operations.DeleteOperation',
179
+ delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
172
180
  additional_bindings: [
173
- { get: '/v1/{name=projects/*/instances/*/operations}' },
181
+ { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
182
+ {
183
+ delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',
184
+ },
185
+ { delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
174
186
  ],
175
187
  },
176
188
  {
177
- selector: 'google.longrunning.Operations.CancelOperation',
178
- post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
189
+ selector: 'google.longrunning.Operations.GetOperation',
190
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
179
191
  additional_bindings: [
180
- { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
192
+ { get: '/v1/{name=projects/*/instances/*/operations/*}' },
193
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}' },
194
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
181
195
  ],
182
196
  },
183
197
  {
184
- selector: 'google.longrunning.Operations.DeleteOperation',
185
- delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
198
+ selector: 'google.longrunning.Operations.ListOperations',
199
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
186
200
  additional_bindings: [
187
- { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
201
+ { get: '/v1/{name=projects/*/instances/*/operations}' },
202
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations}' },
203
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations}' },
188
204
  ],
189
205
  },
190
206
  ];
@@ -261,6 +277,7 @@ class DatabaseAdminClient {
261
277
  'restoreDatabase',
262
278
  'listDatabaseOperations',
263
279
  'listBackupOperations',
280
+ 'listDatabaseRoles',
264
281
  ];
265
282
  for (const methodName of databaseAdminStubMethods) {
266
283
  const callPromise = this.databaseAdminStub.then(stub => (...args) => {
@@ -275,7 +292,7 @@ class DatabaseAdminClient {
275
292
  const descriptor = this.descriptors.page[methodName] ||
276
293
  this.descriptors.longrunning[methodName] ||
277
294
  undefined;
278
- const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
295
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
279
296
  this.innerApiCalls[methodName] = apiCall;
280
297
  }
281
298
  return this.databaseAdminStub;
@@ -539,7 +556,7 @@ class DatabaseAdminClient {
539
556
  async checkCreateDatabaseProgress(name) {
540
557
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
541
558
  const [operation] = await this.operationsClient.getOperation(request);
542
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDatabase, gax.createDefaultBackoffSettings());
559
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
543
560
  return decodeOperation;
544
561
  }
545
562
  updateDatabaseDdl(request, optionsOrCallback, callback) {
@@ -577,7 +594,7 @@ class DatabaseAdminClient {
577
594
  async checkUpdateDatabaseDdlProgress(name) {
578
595
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
579
596
  const [operation] = await this.operationsClient.getOperation(request);
580
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, gax.createDefaultBackoffSettings());
597
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
581
598
  return decodeOperation;
582
599
  }
583
600
  createBackup(request, optionsOrCallback, callback) {
@@ -615,7 +632,7 @@ class DatabaseAdminClient {
615
632
  async checkCreateBackupProgress(name) {
616
633
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
617
634
  const [operation] = await this.operationsClient.getOperation(request);
618
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, gax.createDefaultBackoffSettings());
635
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
619
636
  return decodeOperation;
620
637
  }
621
638
  copyBackup(request, optionsOrCallback, callback) {
@@ -653,7 +670,7 @@ class DatabaseAdminClient {
653
670
  async checkCopyBackupProgress(name) {
654
671
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
655
672
  const [operation] = await this.operationsClient.getOperation(request);
656
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.copyBackup, gax.createDefaultBackoffSettings());
673
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
657
674
  return decodeOperation;
658
675
  }
659
676
  restoreDatabase(request, optionsOrCallback, callback) {
@@ -691,7 +708,7 @@ class DatabaseAdminClient {
691
708
  async checkRestoreDatabaseProgress(name) {
692
709
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
693
710
  const [operation] = await this.operationsClient.getOperation(request);
694
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restoreDatabase, gax.createDefaultBackoffSettings());
711
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
695
712
  return decodeOperation;
696
713
  }
697
714
  listDatabases(request, optionsOrCallback, callback) {
@@ -1404,6 +1421,241 @@ class DatabaseAdminClient {
1404
1421
  this.initialize();
1405
1422
  return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
1406
1423
  }
1424
+ listDatabaseRoles(request, optionsOrCallback, callback) {
1425
+ request = request || {};
1426
+ let options;
1427
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1428
+ callback = optionsOrCallback;
1429
+ options = {};
1430
+ }
1431
+ else {
1432
+ options = optionsOrCallback;
1433
+ }
1434
+ options = options || {};
1435
+ options.otherArgs = options.otherArgs || {};
1436
+ options.otherArgs.headers = options.otherArgs.headers || {};
1437
+ options.otherArgs.headers['x-goog-request-params'] =
1438
+ gax.routingHeader.fromParams({
1439
+ parent: request.parent || '',
1440
+ });
1441
+ this.initialize();
1442
+ return this.innerApiCalls.listDatabaseRoles(request, options, callback);
1443
+ }
1444
+ /**
1445
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1446
+ * @param {Object} request
1447
+ * The request object that will be sent.
1448
+ * @param {string} request.parent
1449
+ * Required. The database whose roles should be listed.
1450
+ * Values are of the form
1451
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1452
+ * @param {number} request.pageSize
1453
+ * Number of database roles to be returned in the response. If 0 or less,
1454
+ * defaults to the server's maximum allowed page size.
1455
+ * @param {string} request.pageToken
1456
+ * If non-empty, `page_token` should contain a
1457
+ * {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
1458
+ * previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1459
+ * @param {object} [options]
1460
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1461
+ * @returns {Stream}
1462
+ * An object stream which emits an object representing [DatabaseRole]{@link google.spanner.admin.database.v1.DatabaseRole} on 'data' event.
1463
+ * The client library will perform auto-pagination by default: it will call the API as many
1464
+ * times as needed. Note that it can affect your quota.
1465
+ * We recommend using `listDatabaseRolesAsync()`
1466
+ * method described below for async iteration which you can stop as needed.
1467
+ * Please see the
1468
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1469
+ * for more details and examples.
1470
+ */
1471
+ listDatabaseRolesStream(request, options) {
1472
+ request = request || {};
1473
+ options = options || {};
1474
+ options.otherArgs = options.otherArgs || {};
1475
+ options.otherArgs.headers = options.otherArgs.headers || {};
1476
+ options.otherArgs.headers['x-goog-request-params'] =
1477
+ gax.routingHeader.fromParams({
1478
+ parent: request.parent || '',
1479
+ });
1480
+ const defaultCallSettings = this._defaults['listDatabaseRoles'];
1481
+ const callSettings = defaultCallSettings.merge(options);
1482
+ this.initialize();
1483
+ return this.descriptors.page.listDatabaseRoles.createStream(this.innerApiCalls.listDatabaseRoles, request, callSettings);
1484
+ }
1485
+ /**
1486
+ * Equivalent to `listDatabaseRoles`, but returns an iterable object.
1487
+ *
1488
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1489
+ * @param {Object} request
1490
+ * The request object that will be sent.
1491
+ * @param {string} request.parent
1492
+ * Required. The database whose roles should be listed.
1493
+ * Values are of the form
1494
+ * `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1495
+ * @param {number} request.pageSize
1496
+ * Number of database roles to be returned in the response. If 0 or less,
1497
+ * defaults to the server's maximum allowed page size.
1498
+ * @param {string} request.pageToken
1499
+ * If non-empty, `page_token` should contain a
1500
+ * {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
1501
+ * previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1502
+ * @param {object} [options]
1503
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1504
+ * @returns {Object}
1505
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
1506
+ * When you iterate the returned iterable, each element will be an object representing
1507
+ * [DatabaseRole]{@link google.spanner.admin.database.v1.DatabaseRole}. The API will be called under the hood as needed, once per the page,
1508
+ * so you can stop the iteration when you don't need more results.
1509
+ * Please see the
1510
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1511
+ * for more details and examples.
1512
+ * @example <caption>include:samples/generated/v1/database_admin.list_database_roles.js</caption>
1513
+ * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_async
1514
+ */
1515
+ listDatabaseRolesAsync(request, options) {
1516
+ request = request || {};
1517
+ options = options || {};
1518
+ options.otherArgs = options.otherArgs || {};
1519
+ options.otherArgs.headers = options.otherArgs.headers || {};
1520
+ options.otherArgs.headers['x-goog-request-params'] =
1521
+ gax.routingHeader.fromParams({
1522
+ parent: request.parent || '',
1523
+ });
1524
+ const defaultCallSettings = this._defaults['listDatabaseRoles'];
1525
+ const callSettings = defaultCallSettings.merge(options);
1526
+ this.initialize();
1527
+ return this.descriptors.page.listDatabaseRoles.asyncIterate(this.innerApiCalls['listDatabaseRoles'], request, callSettings);
1528
+ }
1529
+ /**
1530
+ * Gets the latest state of a long-running operation. Clients can use this
1531
+ * method to poll the operation result at intervals as recommended by the API
1532
+ * service.
1533
+ *
1534
+ * @param {Object} request - The request object that will be sent.
1535
+ * @param {string} request.name - The name of the operation resource.
1536
+ * @param {Object=} options
1537
+ * Optional parameters. You can override the default settings for this call,
1538
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1539
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1540
+ * details.
1541
+ * @param {function(?Error, ?Object)=} callback
1542
+ * The function which will be called with the result of the API call.
1543
+ *
1544
+ * The second parameter to the callback is an object representing
1545
+ * [google.longrunning.Operation]{@link
1546
+ * external:"google.longrunning.Operation"}.
1547
+ * @return {Promise} - The promise which resolves to an array.
1548
+ * The first element of the array is an object representing
1549
+ * [google.longrunning.Operation]{@link
1550
+ * external:"google.longrunning.Operation"}. The promise has a method named
1551
+ * "cancel" which cancels the ongoing API call.
1552
+ *
1553
+ * @example
1554
+ * ```
1555
+ * const client = longrunning.operationsClient();
1556
+ * const name = '';
1557
+ * const [response] = await client.getOperation({name});
1558
+ * // doThingsWith(response)
1559
+ * ```
1560
+ */
1561
+ getOperation(request, options, callback) {
1562
+ return this.operationsClient.getOperation(request, options, callback);
1563
+ }
1564
+ /**
1565
+ * Lists operations that match the specified filter in the request. If the
1566
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
1567
+ *
1568
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
1569
+ *
1570
+ * @param {Object} request - The request object that will be sent.
1571
+ * @param {string} request.name - The name of the operation collection.
1572
+ * @param {string} request.filter - The standard list filter.
1573
+ * @param {number=} request.pageSize -
1574
+ * The maximum number of resources contained in the underlying API
1575
+ * response. If page streaming is performed per-resource, this
1576
+ * parameter does not affect the return value. If page streaming is
1577
+ * performed per-page, this determines the maximum number of
1578
+ * resources in a page.
1579
+ * @param {Object=} options
1580
+ * Optional parameters. You can override the default settings for this call,
1581
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1582
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1583
+ * details.
1584
+ * @returns {Object}
1585
+ * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1586
+ *
1587
+ * @example
1588
+ * ```
1589
+ * const client = longrunning.operationsClient();
1590
+ * for await (const response of client.listOperationsAsync(request));
1591
+ * // doThingsWith(response)
1592
+ * ```
1593
+ */
1594
+ listOperationsAsync(request, options) {
1595
+ return this.operationsClient.listOperationsAsync(request, options);
1596
+ }
1597
+ /**
1598
+ * Starts asynchronous cancellation on a long-running operation. The server
1599
+ * makes a best effort to cancel the operation, but success is not
1600
+ * guaranteed. If the server doesn't support this method, it returns
1601
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
1602
+ * {@link Operations.GetOperation} or
1603
+ * other methods to check whether the cancellation succeeded or whether the
1604
+ * operation completed despite cancellation. On successful cancellation,
1605
+ * the operation is not deleted; instead, it becomes an operation with
1606
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
1607
+ * 1, corresponding to `Code.CANCELLED`.
1608
+ *
1609
+ * @param {Object} request - The request object that will be sent.
1610
+ * @param {string} request.name - The name of the operation resource to be cancelled.
1611
+ * @param {Object=} options
1612
+ * Optional parameters. You can override the default settings for this call,
1613
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1614
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1615
+ * details.
1616
+ * @param {function(?Error)=} callback
1617
+ * The function which will be called with the result of the API call.
1618
+ * @return {Promise} - The promise which resolves when API call finishes.
1619
+ * The promise has a method named "cancel" which cancels the ongoing API
1620
+ * call.
1621
+ *
1622
+ * @example
1623
+ * ```
1624
+ * const client = longrunning.operationsClient();
1625
+ * await client.cancelOperation({name: ''});
1626
+ * ```
1627
+ */
1628
+ cancelOperation(request, options, callback) {
1629
+ return this.operationsClient.cancelOperation(request, options, callback);
1630
+ }
1631
+ /**
1632
+ * Deletes a long-running operation. This method indicates that the client is
1633
+ * no longer interested in the operation result. It does not cancel the
1634
+ * operation. If the server doesn't support this method, it returns
1635
+ * `google.rpc.Code.UNIMPLEMENTED`.
1636
+ *
1637
+ * @param {Object} request - The request object that will be sent.
1638
+ * @param {string} request.name - The name of the operation resource to be deleted.
1639
+ * @param {Object=} options
1640
+ * Optional parameters. You can override the default settings for this call,
1641
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
1642
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
1643
+ * details.
1644
+ * @param {function(?Error)=} callback
1645
+ * The function which will be called with the result of the API call.
1646
+ * @return {Promise} - The promise which resolves when API call finishes.
1647
+ * The promise has a method named "cancel" which cancels the ongoing API
1648
+ * call.
1649
+ *
1650
+ * @example
1651
+ * ```
1652
+ * const client = longrunning.operationsClient();
1653
+ * await client.deleteOperation({name: ''});
1654
+ * ```
1655
+ */
1656
+ deleteOperation(request, options, callback) {
1657
+ return this.operationsClient.deleteOperation(request, options, callback);
1658
+ }
1407
1659
  // --------------------
1408
1660
  // -- Path templates --
1409
1661
  // --------------------
@@ -1558,6 +1810,67 @@ class DatabaseAdminClient {
1558
1810
  matchDatabaseFromDatabaseName(databaseName) {
1559
1811
  return this.pathTemplates.databasePathTemplate.match(databaseName).database;
1560
1812
  }
1813
+ /**
1814
+ * Return a fully-qualified databaseRole resource name string.
1815
+ *
1816
+ * @param {string} project
1817
+ * @param {string} instance
1818
+ * @param {string} database
1819
+ * @param {string} role
1820
+ * @returns {string} Resource name string.
1821
+ */
1822
+ databaseRolePath(project, instance, database, role) {
1823
+ return this.pathTemplates.databaseRolePathTemplate.render({
1824
+ project: project,
1825
+ instance: instance,
1826
+ database: database,
1827
+ role: role,
1828
+ });
1829
+ }
1830
+ /**
1831
+ * Parse the project from DatabaseRole resource.
1832
+ *
1833
+ * @param {string} databaseRoleName
1834
+ * A fully-qualified path representing DatabaseRole resource.
1835
+ * @returns {string} A string representing the project.
1836
+ */
1837
+ matchProjectFromDatabaseRoleName(databaseRoleName) {
1838
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
1839
+ .project;
1840
+ }
1841
+ /**
1842
+ * Parse the instance from DatabaseRole resource.
1843
+ *
1844
+ * @param {string} databaseRoleName
1845
+ * A fully-qualified path representing DatabaseRole resource.
1846
+ * @returns {string} A string representing the instance.
1847
+ */
1848
+ matchInstanceFromDatabaseRoleName(databaseRoleName) {
1849
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
1850
+ .instance;
1851
+ }
1852
+ /**
1853
+ * Parse the database from DatabaseRole resource.
1854
+ *
1855
+ * @param {string} databaseRoleName
1856
+ * A fully-qualified path representing DatabaseRole resource.
1857
+ * @returns {string} A string representing the database.
1858
+ */
1859
+ matchDatabaseFromDatabaseRoleName(databaseRoleName) {
1860
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
1861
+ .database;
1862
+ }
1863
+ /**
1864
+ * Parse the role from DatabaseRole resource.
1865
+ *
1866
+ * @param {string} databaseRoleName
1867
+ * A fully-qualified path representing DatabaseRole resource.
1868
+ * @returns {string} A string representing the role.
1869
+ */
1870
+ matchRoleFromDatabaseRoleName(databaseRoleName) {
1871
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
1872
+ .role;
1873
+ }
1561
1874
  /**
1562
1875
  * Return a fully-qualified instance resource name string.
1563
1876
  *
@@ -118,6 +118,11 @@
118
118
  "timeout_millis": 3600000,
119
119
  "retry_codes_name": "idempotent",
120
120
  "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
121
+ },
122
+ "ListDatabaseRoles": {
123
+ "timeout_millis": 3600000,
124
+ "retry_codes_name": "idempotent",
125
+ "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
121
126
  }
122
127
  }
123
128
  }
@@ -269,7 +269,7 @@ class InstanceAdminClient {
269
269
  const descriptor = this.descriptors.page[methodName] ||
270
270
  this.descriptors.longrunning[methodName] ||
271
271
  undefined;
272
- const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
272
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
273
273
  this.innerApiCalls[methodName] = apiCall;
274
274
  }
275
275
  return this.instanceAdminStub;
@@ -473,7 +473,7 @@ class InstanceAdminClient {
473
473
  async checkCreateInstanceProgress(name) {
474
474
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
475
475
  const [operation] = await this.operationsClient.getOperation(request);
476
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings());
476
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings());
477
477
  return decodeOperation;
478
478
  }
479
479
  updateInstance(request, optionsOrCallback, callback) {
@@ -511,7 +511,7 @@ class InstanceAdminClient {
511
511
  async checkUpdateInstanceProgress(name) {
512
512
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
513
513
  const [operation] = await this.operationsClient.getOperation(request);
514
- const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings());
514
+ const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
515
515
  return decodeOperation;
516
516
  }
517
517
  listInstanceConfigs(request, optionsOrCallback, callback) {
@@ -217,7 +217,7 @@ class SpannerClient {
217
217
  const descriptor = this.descriptors.page[methodName] ||
218
218
  this.descriptors.stream[methodName] ||
219
219
  undefined;
220
- const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
220
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
221
221
  this.innerApiCalls[methodName] = apiCall;
222
222
  }
223
223
  return this.spannerStub;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@google-cloud/spanner",
3
3
  "description": "Cloud Spanner Client Library for Node.js",
4
- "version": "6.1.1",
4
+ "version": "6.1.4",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc.",
7
7
  "engines": {
@@ -50,9 +50,9 @@
50
50
  "compile-protos": "compileProtos src"
51
51
  },
52
52
  "dependencies": {
53
- "@google-cloud/common": "^3.0.0",
53
+ "@google-cloud/common": "^4.0.0",
54
54
  "@google-cloud/precise-date": "^2.0.0",
55
- "@google-cloud/projectify": "^2.0.0",
55
+ "@google-cloud/projectify": "^3.0.0",
56
56
  "@google-cloud/promisify": "^3.0.0",
57
57
  "@types/big.js": "^6.0.0",
58
58
  "@types/stack-trace": "0.0.29",
@@ -68,20 +68,20 @@
68
68
  "lodash.snakecase": "^4.1.1",
69
69
  "merge-stream": "^2.0.0",
70
70
  "p-queue": "^6.0.2",
71
- "protobufjs": "^6.10.1",
71
+ "protobufjs": "^7.0.0",
72
72
  "split-array-stream": "^2.0.0",
73
73
  "stack-trace": "0.0.10",
74
74
  "stream-events": "^1.0.4",
75
75
  "through2": "^4.0.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@grpc/proto-loader": "^0.6.0",
78
+ "@grpc/proto-loader": "^0.7.0",
79
79
  "@types/concat-stream": "^2.0.0",
80
80
  "@types/extend": "^3.0.0",
81
81
  "@types/is": "0.0.21",
82
82
  "@types/lodash.snakecase": "^4.1.4",
83
83
  "@types/merge-stream": "^1.1.2",
84
- "@types/mocha": "^8.0.0",
84
+ "@types/mocha": "^9.0.0",
85
85
  "@types/mv": "^2.1.0",
86
86
  "@types/ncp": "^2.0.1",
87
87
  "@types/proxyquire": "^1.3.28",
@@ -98,8 +98,8 @@
98
98
  "execa": "^5.0.0",
99
99
  "gts": "^3.1.0",
100
100
  "jsdoc": "^3.6.2",
101
- "jsdoc-fresh": "^1.0.1",
102
- "jsdoc-region-tag": "^1.0.2",
101
+ "jsdoc-fresh": "^2.0.0",
102
+ "jsdoc-region-tag": "^2.0.0",
103
103
  "linkinator": "^2.0.0",
104
104
  "lodash.random": "^3.2.0",
105
105
  "mocha": "^9.2.2",