@@ -67,8 +67,10 @@
Loading
67 67
  /**
68 68
   * Construct an instance of DatabaseAdminClient.
69 69
   *
70 -
   * @param {object} [options] - The configuration object. See the subsequent
71 -
   *   parameters for more details.
70 +
   * @param {object} [options] - The configuration object.
71 +
   * The options accepted by the constructor are described in detail
72 +
   * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
73 +
   * The common options are:
72 74
   * @param {object} [options.credentials] - Credentials object.
73 75
   * @param {string} [options.credentials.client_email]
74 76
   * @param {string} [options.credentials.private_key]
@@ -88,42 +90,33 @@
Loading
88 90
   *     your project ID will be detected automatically.
89 91
   * @param {string} [options.apiEndpoint] - The domain name of the
90 92
   *     API remote host.
93 +
   * @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
94 +
   *     TODO(@alexander-fenster): link to gax documentation.
95 +
   * @param {boolean} fallback - Use HTTP fallback mode.
96 +
   *     In fallback mode, a special browser-compatible transport implementation is used
97 +
   *     instead of gRPC transport. In browser context (if the `window` object is defined)
98 +
   *     the fallback mode is enabled automatically; set `options.fallback` to `false`
99 +
   *     if you need to override this behavior.
91 100
   */
92 -
93 101
  constructor(opts?: ClientOptions) {
94 -
    // Ensure that options include the service address and port.
102 +
    // Ensure that options include all the required fields.
95 103
    const staticMembers = this.constructor as typeof DatabaseAdminClient;
96 104
    const servicePath =
97 -
      opts && opts.servicePath
98 -
        ? opts.servicePath
99 -
        : opts && opts.apiEndpoint
100 -
        ? opts.apiEndpoint
101 -
        : staticMembers.servicePath;
102 -
    const port = opts && opts.port ? opts.port : staticMembers.port;
105 +
      opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
106 +
    const port = opts?.port || staticMembers.port;
107 +
    const clientConfig = opts?.clientConfig ?? {};
108 +
    const fallback = opts?.fallback ?? typeof window !== 'undefined';
109 +
    opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
103 110
104 -
    if (!opts) {
105 -
      opts = {servicePath, port};
111 +
    // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
112 +
    if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
113 +
      opts['scopes'] = staticMembers.scopes;
106 114
    }
107 -
    opts.servicePath = opts.servicePath || servicePath;
108 -
    opts.port = opts.port || port;
109 -
110 -
    // users can override the config from client side, like retry codes name.
111 -
    // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
112 -
    // The way to override client config for Showcase API:
113 -
    //
114 -
    // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
115 -
    // const showcaseClient = new showcaseClient({ projectId, customConfig });
116 -
    opts.clientConfig = opts.clientConfig || {};
117 115
118 -
    // If we're running in browser, it's OK to omit `fallback` since
119 -
    // google-gax has `browser` field in its `package.json`.
120 -
    // For Electron (which does not respect `browser` field),
121 -
    // pass `{fallback: true}` to the DatabaseAdminClient constructor.
116 +
    // Choose either gRPC or proto-over-HTTP implementation of google-gax.
122 117
    this._gaxModule = opts.fallback ? gax.fallback : gax;
123 118
124 -
    // Create a `gaxGrpc` object, with any grpc-specific options
125 -
    // sent to the client.
126 -
    opts.scopes = (this.constructor as typeof DatabaseAdminClient).scopes;
119 +
    // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
127 120
    this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
128 121
129 122
    // Save options to use in initialize() method.
@@ -132,6 +125,11 @@
Loading
132 125
    // Save the auth object to the client, for use by other methods.
133 126
    this.auth = this._gaxGrpc.auth as gax.GoogleAuth;
134 127
128 +
    // Set the default scopes in auth client if needed.
129 +
    if (servicePath === staticMembers.servicePath) {
130 +
      this.auth.defaultScopes = staticMembers.scopes;
131 +
    }
132 +
135 133
    // Determine the client header string.
136 134
    const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
137 135
    if (typeof process !== 'undefined' && 'versions' in process) {
@@ -364,6 +362,7 @@
Loading
364 362
365 363
  /**
366 364
   * The DNS address for this API service.
365 +
   * @returns {string} The DNS address for this service.
367 366
   */
368 367
  static get servicePath() {
369 368
    return 'spanner.googleapis.com';
@@ -372,6 +371,7 @@
Loading
372 371
  /**
373 372
   * The DNS address for this API service - same as servicePath(),
374 373
   * exists for compatibility reasons.
374 +
   * @returns {string} The DNS address for this service.
375 375
   */
376 376
  static get apiEndpoint() {
377 377
    return 'spanner.googleapis.com';
@@ -379,6 +379,7 @@
Loading
379 379
380 380
  /**
381 381
   * The port for this API service.
382 +
   * @returns {number} The default port for this service.
382 383
   */
383 384
  static get port() {
384 385
    return 443;
@@ -387,6 +388,7 @@
Loading
387 388
  /**
388 389
   * The scopes needed to make gRPC calls for every method defined
389 390
   * in this service.
391 +
   * @returns {string[]} List of default scopes.
390 392
   */
391 393
  static get scopes() {
392 394
    return [
@@ -399,8 +401,7 @@
Loading
399 401
  getProjectId(callback: Callback<string, undefined, undefined>): void;
400 402
  /**
401 403
   * Return the project ID used by this class.
402 -
   * @param {function(Error, string)} callback - the callback to
403 -
   *   be called with the current project Id.
404 +
   * @returns {Promise} A promise that resolves to string containing the project ID.
404 405
   */
405 406
  getProjectId(
406 407
    callback?: Callback<string, undefined, undefined>
@@ -458,7 +459,11 @@
Loading
458 459
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
459 460
   * @returns {Promise} - The promise which resolves to an array.
460 461
   *   The first element of the array is an object representing [Database]{@link google.spanner.admin.database.v1.Database}.
461 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
462 +
   *   Please see the
463 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
464 +
   *   for more details and examples.
465 +
   * @example
466 +
   * const [response] = await client.getDatabase(request);
462 467
   */
463 468
  getDatabase(
464 469
    request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest,
@@ -548,7 +553,11 @@
Loading
548 553
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
549 554
   * @returns {Promise} - The promise which resolves to an array.
550 555
   *   The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
551 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
556 +
   *   Please see the
557 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
558 +
   *   for more details and examples.
559 +
   * @example
560 +
   * const [response] = await client.dropDatabase(request);
552 561
   */
553 562
  dropDatabase(
554 563
    request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest,
@@ -641,7 +650,11 @@
Loading
641 650
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
642 651
   * @returns {Promise} - The promise which resolves to an array.
643 652
   *   The first element of the array is an object representing [GetDatabaseDdlResponse]{@link google.spanner.admin.database.v1.GetDatabaseDdlResponse}.
644 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
653 +
   *   Please see the
654 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
655 +
   *   for more details and examples.
656 +
   * @example
657 +
   * const [response] = await client.getDatabaseDdl(request);
645 658
   */
646 659
  getDatabaseDdl(
647 660
    request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest,
@@ -740,7 +753,11 @@
Loading
740 753
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
741 754
   * @returns {Promise} - The promise which resolves to an array.
742 755
   *   The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
743 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
756 +
   *   Please see the
757 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
758 +
   *   for more details and examples.
759 +
   * @example
760 +
   * const [response] = await client.setIamPolicy(request);
744 761
   */
745 762
  setIamPolicy(
746 763
    request: protos.google.iam.v1.ISetIamPolicyRequest,
@@ -831,7 +848,11 @@
Loading
831 848
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
832 849
   * @returns {Promise} - The promise which resolves to an array.
833 850
   *   The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
834 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
851 +
   *   Please see the
852 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
853 +
   *   for more details and examples.
854 +
   * @example
855 +
   * const [response] = await client.getIamPolicy(request);
835 856
   */
836 857
  getIamPolicy(
837 858
    request: protos.google.iam.v1.IGetIamPolicyRequest,
@@ -926,7 +947,11 @@
Loading
926 947
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
927 948
   * @returns {Promise} - The promise which resolves to an array.
928 949
   *   The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
929 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
950 +
   *   Please see the
951 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
952 +
   *   for more details and examples.
953 +
   * @example
954 +
   * const [response] = await client.testIamPermissions(request);
930 955
   */
931 956
  testIamPermissions(
932 957
    request: protos.google.iam.v1.ITestIamPermissionsRequest,
@@ -1012,7 +1037,11 @@
Loading
1012 1037
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1013 1038
   * @returns {Promise} - The promise which resolves to an array.
1014 1039
   *   The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
1015 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1040 +
   *   Please see the
1041 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1042 +
   *   for more details and examples.
1043 +
   * @example
1044 +
   * const [response] = await client.getBackup(request);
1016 1045
   */
1017 1046
  getBackup(
1018 1047
    request: protos.google.spanner.admin.database.v1.IGetBackupRequest,
@@ -1109,7 +1138,11 @@
Loading
1109 1138
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1110 1139
   * @returns {Promise} - The promise which resolves to an array.
1111 1140
   *   The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
1112 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1141 +
   *   Please see the
1142 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1143 +
   *   for more details and examples.
1144 +
   * @example
1145 +
   * const [response] = await client.updateBackup(request);
1113 1146
   */
1114 1147
  updateBackup(
1115 1148
    request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest,
@@ -1199,7 +1232,11 @@
Loading
1199 1232
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1200 1233
   * @returns {Promise} - The promise which resolves to an array.
1201 1234
   *   The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
1202 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1235 +
   *   Please see the
1236 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1237 +
   *   for more details and examples.
1238 +
   * @example
1239 +
   * const [response] = await client.deleteBackup(request);
1203 1240
   */
1204 1241
  deleteBackup(
1205 1242
    request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest,
@@ -1311,8 +1348,15 @@
Loading
1311 1348
   * @param {object} [options]
1312 1349
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1313 1350
   * @returns {Promise} - The promise which resolves to an array.
1314 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1315 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1351 +
   *   The first element of the array is an object representing
1352 +
   *   a long running operation. Its `promise()` method returns a promise
1353 +
   *   you can `await` for.
1354 +
   *   Please see the
1355 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1356 +
   *   for more details and examples.
1357 +
   * @example
1358 +
   * const [operation] = await client.createDatabase(request);
1359 +
   * const [response] = await operation.promise();
1316 1360
   */
1317 1361
  createDatabase(
1318 1362
    request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest,
@@ -1364,18 +1408,19 @@
Loading
1364 1408
    return this.innerApiCalls.createDatabase(request, options, callback);
1365 1409
  }
1366 1410
  /**
1367 -
   * Check the status of the long running operation returned by the createDatabase() method.
1411 +
   * Check the status of the long running operation returned by `createDatabase()`.
1368 1412
   * @param {String} name
1369 1413
   *   The operation name that will be passed.
1370 1414
   * @returns {Promise} - The promise which resolves to an object.
1371 1415
   *   The decoded operation object has result and metadata field to get information from.
1372 -
   *
1373 -
   * @example:
1374 -
   *   const decodedOperation = await checkCreateDatabaseProgress(name);
1375 -
   *   console.log(decodedOperation.result);
1376 -
   *   console.log(decodedOperation.done);
1377 -
   *   console.log(decodedOperation.metadata);
1378 -
   *
1416 +
   *   Please see the
1417 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1418 +
   *   for more details and examples.
1419 +
   * @example
1420 +
   * const decodedOperation = await checkCreateDatabaseProgress(name);
1421 +
   * console.log(decodedOperation.result);
1422 +
   * console.log(decodedOperation.done);
1423 +
   * console.log(decodedOperation.metadata);
1379 1424
   */
1380 1425
  async checkCreateDatabaseProgress(
1381 1426
    name: string
@@ -1473,8 +1518,15 @@
Loading
1473 1518
   * @param {object} [options]
1474 1519
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1475 1520
   * @returns {Promise} - The promise which resolves to an array.
1476 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1477 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1521 +
   *   The first element of the array is an object representing
1522 +
   *   a long running operation. Its `promise()` method returns a promise
1523 +
   *   you can `await` for.
1524 +
   *   Please see the
1525 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1526 +
   *   for more details and examples.
1527 +
   * @example
1528 +
   * const [operation] = await client.updateDatabaseDdl(request);
1529 +
   * const [response] = await operation.promise();
1478 1530
   */
1479 1531
  updateDatabaseDdl(
1480 1532
    request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest,
@@ -1526,18 +1578,19 @@
Loading
1526 1578
    return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
1527 1579
  }
1528 1580
  /**
1529 -
   * Check the status of the long running operation returned by the updateDatabaseDdl() method.
1581 +
   * Check the status of the long running operation returned by `updateDatabaseDdl()`.
1530 1582
   * @param {String} name
1531 1583
   *   The operation name that will be passed.
1532 1584
   * @returns {Promise} - The promise which resolves to an object.
1533 1585
   *   The decoded operation object has result and metadata field to get information from.
1534 -
   *
1535 -
   * @example:
1536 -
   *   const decodedOperation = await checkUpdateDatabaseDdlProgress(name);
1537 -
   *   console.log(decodedOperation.result);
1538 -
   *   console.log(decodedOperation.done);
1539 -
   *   console.log(decodedOperation.metadata);
1540 -
   *
1586 +
   *   Please see the
1587 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1588 +
   *   for more details and examples.
1589 +
   * @example
1590 +
   * const decodedOperation = await checkUpdateDatabaseDdlProgress(name);
1591 +
   * console.log(decodedOperation.result);
1592 +
   * console.log(decodedOperation.done);
1593 +
   * console.log(decodedOperation.metadata);
1541 1594
   */
1542 1595
  async checkUpdateDatabaseDdlProgress(
1543 1596
    name: string
@@ -1629,8 +1682,15 @@
Loading
1629 1682
   * @param {object} [options]
1630 1683
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1631 1684
   * @returns {Promise} - The promise which resolves to an array.
1632 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1633 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1685 +
   *   The first element of the array is an object representing
1686 +
   *   a long running operation. Its `promise()` method returns a promise
1687 +
   *   you can `await` for.
1688 +
   *   Please see the
1689 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1690 +
   *   for more details and examples.
1691 +
   * @example
1692 +
   * const [operation] = await client.createBackup(request);
1693 +
   * const [response] = await operation.promise();
1634 1694
   */
1635 1695
  createBackup(
1636 1696
    request: protos.google.spanner.admin.database.v1.ICreateBackupRequest,
@@ -1682,18 +1742,19 @@
Loading
1682 1742
    return this.innerApiCalls.createBackup(request, options, callback);
1683 1743
  }
1684 1744
  /**
1685 -
   * Check the status of the long running operation returned by the createBackup() method.
1745 +
   * Check the status of the long running operation returned by `createBackup()`.
1686 1746
   * @param {String} name
1687 1747
   *   The operation name that will be passed.
1688 1748
   * @returns {Promise} - The promise which resolves to an object.
1689 1749
   *   The decoded operation object has result and metadata field to get information from.
1690 -
   *
1691 -
   * @example:
1692 -
   *   const decodedOperation = await checkCreateBackupProgress(name);
1693 -
   *   console.log(decodedOperation.result);
1694 -
   *   console.log(decodedOperation.done);
1695 -
   *   console.log(decodedOperation.metadata);
1696 -
   *
1750 +
   *   Please see the
1751 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1752 +
   *   for more details and examples.
1753 +
   * @example
1754 +
   * const decodedOperation = await checkCreateBackupProgress(name);
1755 +
   * console.log(decodedOperation.result);
1756 +
   * console.log(decodedOperation.done);
1757 +
   * console.log(decodedOperation.metadata);
1697 1758
   */
1698 1759
  async checkCreateBackupProgress(
1699 1760
    name: string
@@ -1791,8 +1852,15 @@
Loading
1791 1852
   * @param {object} [options]
1792 1853
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1793 1854
   * @returns {Promise} - The promise which resolves to an array.
1794 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1795 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1855 +
   *   The first element of the array is an object representing
1856 +
   *   a long running operation. Its `promise()` method returns a promise
1857 +
   *   you can `await` for.
1858 +
   *   Please see the
1859 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1860 +
   *   for more details and examples.
1861 +
   * @example
1862 +
   * const [operation] = await client.restoreDatabase(request);
1863 +
   * const [response] = await operation.promise();
1796 1864
   */
1797 1865
  restoreDatabase(
1798 1866
    request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest,
@@ -1844,18 +1912,19 @@
Loading
1844 1912
    return this.innerApiCalls.restoreDatabase(request, options, callback);
1845 1913
  }
1846 1914
  /**
1847 -
   * Check the status of the long running operation returned by the restoreDatabase() method.
1915 +
   * Check the status of the long running operation returned by `restoreDatabase()`.
1848 1916
   * @param {String} name
1849 1917
   *   The operation name that will be passed.
1850 1918
   * @returns {Promise} - The promise which resolves to an object.
1851 1919
   *   The decoded operation object has result and metadata field to get information from.
1852 -
   *
1853 -
   * @example:
1854 -
   *   const decodedOperation = await checkRestoreDatabaseProgress(name);
1855 -
   *   console.log(decodedOperation.result);
1856 -
   *   console.log(decodedOperation.done);
1857 -
   *   console.log(decodedOperation.metadata);
1858 -
   *
1920 +
   *   Please see the
1921 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1922 +
   *   for more details and examples.
1923 +
   * @example
1924 +
   * const decodedOperation = await checkRestoreDatabaseProgress(name);
1925 +
   * console.log(decodedOperation.result);
1926 +
   * console.log(decodedOperation.done);
1927 +
   * console.log(decodedOperation.metadata);
1859 1928
   */
1860 1929
  async checkRestoreDatabaseProgress(
1861 1930
    name: string
@@ -1929,19 +1998,14 @@
Loading
1929 1998
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1930 1999
   * @returns {Promise} - The promise which resolves to an array.
1931 2000
   *   The first element of the array is Array of [Database]{@link google.spanner.admin.database.v1.Database}.
1932 -
   *   The client library support auto-pagination by default: it will call the API as many
2001 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1933 2002
   *   times as needed and will merge results from all the pages into this array.
1934 -
   *
1935 -
   *   When autoPaginate: false is specified through options, the array has three elements.
1936 -
   *   The first element is Array of [Database]{@link google.spanner.admin.database.v1.Database} that corresponds to
1937 -
   *   the one page received from the API server.
1938 -
   *   If the second element is not null it contains the request object of type [ListDatabasesRequest]{@link google.spanner.admin.database.v1.ListDatabasesRequest}
1939 -
   *   that can be used to obtain the next page of the results.
1940 -
   *   If it is null, the next page does not exist.
1941 -
   *   The third element contains the raw response received from the API server. Its type is
1942 -
   *   [ListDatabasesResponse]{@link google.spanner.admin.database.v1.ListDatabasesResponse}.
1943 -
   *
1944 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
2003 +
   *   Note that it can affect your quota.
2004 +
   *   We recommend using `listDatabasesAsync()`
2005 +
   *   method described below for async iteration which you can stop as needed.
2006 +
   *   Please see the
2007 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2008 +
   *   for more details and examples.
1945 2009
   */
1946 2010
  listDatabases(
1947 2011
    request: protos.google.spanner.admin.database.v1.IListDatabasesRequest,
@@ -1989,18 +2053,7 @@
Loading
1989 2053
  }
1990 2054
1991 2055
  /**
1992 -
   * Equivalent to {@link listDatabases}, but returns a NodeJS Stream object.
1993 -
   *
1994 -
   * This fetches the paged responses for {@link listDatabases} continuously
1995 -
   * and invokes the callback registered for 'data' event for each element in the
1996 -
   * responses.
1997 -
   *
1998 -
   * The returned object has 'end' method when no more elements are required.
1999 -
   *
2000 -
   * autoPaginate option will be ignored.
2001 -
   *
2002 -
   * @see {@link https://nodejs.org/api/stream.html}
2003 -
   *
2056 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
2004 2057
   * @param {Object} request
2005 2058
   *   The request object that will be sent.
2006 2059
   * @param {string} request.parent
@@ -2017,6 +2070,13 @@
Loading
2017 2070
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2018 2071
   * @returns {Stream}
2019 2072
   *   An object stream which emits an object representing [Database]{@link google.spanner.admin.database.v1.Database} on 'data' event.
2073 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2074 +
   *   times as needed. Note that it can affect your quota.
2075 +
   *   We recommend using `listDatabasesAsync()`
2076 +
   *   method described below for async iteration which you can stop as needed.
2077 +
   *   Please see the
2078 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2079 +
   *   for more details and examples.
2020 2080
   */
2021 2081
  listDatabasesStream(
2022 2082
    request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest,
@@ -2041,10 +2101,9 @@
Loading
2041 2101
  }
2042 2102
2043 2103
  /**
2044 -
   * Equivalent to {@link listDatabases}, but returns an iterable object.
2045 -
   *
2046 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
2104 +
   * Equivalent to `listDatabases`, but returns an iterable object.
2047 2105
   *
2106 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2048 2107
   * @param {Object} request
2049 2108
   *   The request object that will be sent.
2050 2109
   * @param {string} request.parent
@@ -2060,7 +2119,18 @@
Loading
2060 2119
   * @param {object} [options]
2061 2120
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2062 2121
   * @returns {Object}
2063 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
2122 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
2123 +
   *   When you iterate the returned iterable, each element will be an object representing
2124 +
   *   [Database]{@link google.spanner.admin.database.v1.Database}. The API will be called under the hood as needed, once per the page,
2125 +
   *   so you can stop the iteration when you don't need more results.
2126 +
   *   Please see the
2127 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2128 +
   *   for more details and examples.
2129 +
   * @example
2130 +
   * const iterable = client.listDatabasesAsync(request);
2131 +
   * for await (const response of iterable) {
2132 +
   *   // process response
2133 +
   * }
2064 2134
   */
2065 2135
  listDatabasesAsync(
2066 2136
    request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest,
@@ -2172,19 +2242,14 @@
Loading
2172 2242
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2173 2243
   * @returns {Promise} - The promise which resolves to an array.
2174 2244
   *   The first element of the array is Array of [Backup]{@link google.spanner.admin.database.v1.Backup}.
2175 -
   *   The client library support auto-pagination by default: it will call the API as many
2245 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2176 2246
   *   times as needed and will merge results from all the pages into this array.
2177 -
   *
2178 -
   *   When autoPaginate: false is specified through options, the array has three elements.
2179 -
   *   The first element is Array of [Backup]{@link google.spanner.admin.database.v1.Backup} that corresponds to
2180 -
   *   the one page received from the API server.
2181 -
   *   If the second element is not null it contains the request object of type [ListBackupsRequest]{@link google.spanner.admin.database.v1.ListBackupsRequest}
2182 -
   *   that can be used to obtain the next page of the results.
2183 -
   *   If it is null, the next page does not exist.
2184 -
   *   The third element contains the raw response received from the API server. Its type is
2185 -
   *   [ListBackupsResponse]{@link google.spanner.admin.database.v1.ListBackupsResponse}.
2186 -
   *
2187 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
2247 +
   *   Note that it can affect your quota.
2248 +
   *   We recommend using `listBackupsAsync()`
2249 +
   *   method described below for async iteration which you can stop as needed.
2250 +
   *   Please see the
2251 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2252 +
   *   for more details and examples.
2188 2253
   */
2189 2254
  listBackups(
2190 2255
    request: protos.google.spanner.admin.database.v1.IListBackupsRequest,
@@ -2232,18 +2297,7 @@
Loading
2232 2297
  }
2233 2298
2234 2299
  /**
2235 -
   * Equivalent to {@link listBackups}, but returns a NodeJS Stream object.
2236 -
   *
2237 -
   * This fetches the paged responses for {@link listBackups} continuously
2238 -
   * and invokes the callback registered for 'data' event for each element in the
2239 -
   * responses.
2240 -
   *
2241 -
   * The returned object has 'end' method when no more elements are required.
2242 -
   *
2243 -
   * autoPaginate option will be ignored.
2244 -
   *
2245 -
   * @see {@link https://nodejs.org/api/stream.html}
2246 -
   *
2300 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
2247 2301
   * @param {Object} request
2248 2302
   *   The request object that will be sent.
2249 2303
   * @param {string} request.parent
@@ -2296,6 +2350,13 @@
Loading
2296 2350
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2297 2351
   * @returns {Stream}
2298 2352
   *   An object stream which emits an object representing [Backup]{@link google.spanner.admin.database.v1.Backup} on 'data' event.
2353 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2354 +
   *   times as needed. Note that it can affect your quota.
2355 +
   *   We recommend using `listBackupsAsync()`
2356 +
   *   method described below for async iteration which you can stop as needed.
2357 +
   *   Please see the
2358 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2359 +
   *   for more details and examples.
2299 2360
   */
2300 2361
  listBackupsStream(
2301 2362
    request?: protos.google.spanner.admin.database.v1.IListBackupsRequest,
@@ -2320,10 +2381,9 @@
Loading
2320 2381
  }
2321 2382
2322 2383
  /**
2323 -
   * Equivalent to {@link listBackups}, but returns an iterable object.
2324 -
   *
2325 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
2384 +
   * Equivalent to `listBackups`, but returns an iterable object.
2326 2385
   *
2386 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2327 2387
   * @param {Object} request
2328 2388
   *   The request object that will be sent.
2329 2389
   * @param {string} request.parent
@@ -2375,7 +2435,18 @@
Loading
2375 2435
   * @param {object} [options]
2376 2436
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2377 2437
   * @returns {Object}
2378 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
2438 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
2439 +
   *   When you iterate the returned iterable, each element will be an object representing
2440 +
   *   [Backup]{@link google.spanner.admin.database.v1.Backup}. The API will be called under the hood as needed, once per the page,
2441 +
   *   so you can stop the iteration when you don't need more results.
2442 +
   *   Please see the
2443 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2444 +
   *   for more details and examples.
2445 +
   * @example
2446 +
   * const iterable = client.listBackupsAsync(request);
2447 +
   * for await (const response of iterable) {
2448 +
   *   // process response
2449 +
   * }
2379 2450
   */
2380 2451
  listBackupsAsync(
2381 2452
    request?: protos.google.spanner.admin.database.v1.IListBackupsRequest,
@@ -2498,19 +2569,14 @@
Loading
2498 2569
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2499 2570
   * @returns {Promise} - The promise which resolves to an array.
2500 2571
   *   The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
2501 -
   *   The client library support auto-pagination by default: it will call the API as many
2572 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2502 2573
   *   times as needed and will merge results from all the pages into this array.
2503 -
   *
2504 -
   *   When autoPaginate: false is specified through options, the array has three elements.
2505 -
   *   The first element is Array of [Operation]{@link google.longrunning.Operation} that corresponds to
2506 -
   *   the one page received from the API server.
2507 -
   *   If the second element is not null it contains the request object of type [ListDatabaseOperationsRequest]{@link google.spanner.admin.database.v1.ListDatabaseOperationsRequest}
2508 -
   *   that can be used to obtain the next page of the results.
2509 -
   *   If it is null, the next page does not exist.
2510 -
   *   The third element contains the raw response received from the API server. Its type is
2511 -
   *   [ListDatabaseOperationsResponse]{@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse}.
2512 -
   *
2513 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
2574 +
   *   Note that it can affect your quota.
2575 +
   *   We recommend using `listDatabaseOperationsAsync()`
2576 +
   *   method described below for async iteration which you can stop as needed.
2577 +
   *   Please see the
2578 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2579 +
   *   for more details and examples.
2514 2580
   */
2515 2581
  listDatabaseOperations(
2516 2582
    request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest,
@@ -2562,18 +2628,7 @@
Loading
2562 2628
  }
2563 2629
2564 2630
  /**
2565 -
   * Equivalent to {@link listDatabaseOperations}, but returns a NodeJS Stream object.
2566 -
   *
2567 -
   * This fetches the paged responses for {@link listDatabaseOperations} continuously
2568 -
   * and invokes the callback registered for 'data' event for each element in the
2569 -
   * responses.
2570 -
   *
2571 -
   * The returned object has 'end' method when no more elements are required.
2572 -
   *
2573 -
   * autoPaginate option will be ignored.
2574 -
   *
2575 -
   * @see {@link https://nodejs.org/api/stream.html}
2576 -
   *
2631 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
2577 2632
   * @param {Object} request
2578 2633
   *   The request object that will be sent.
2579 2634
   * @param {string} request.parent
@@ -2632,6 +2687,13 @@
Loading
2632 2687
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2633 2688
   * @returns {Stream}
2634 2689
   *   An object stream which emits an object representing [Operation]{@link google.longrunning.Operation} on 'data' event.
2690 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2691 +
   *   times as needed. Note that it can affect your quota.
2692 +
   *   We recommend using `listDatabaseOperationsAsync()`
2693 +
   *   method described below for async iteration which you can stop as needed.
2694 +
   *   Please see the
2695 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2696 +
   *   for more details and examples.
2635 2697
   */
2636 2698
  listDatabaseOperationsStream(
2637 2699
    request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest,
@@ -2656,10 +2718,9 @@
Loading
2656 2718
  }
2657 2719
2658 2720
  /**
2659 -
   * Equivalent to {@link listDatabaseOperations}, but returns an iterable object.
2660 -
   *
2661 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
2721 +
   * Equivalent to `listDatabaseOperations`, but returns an iterable object.
2662 2722
   *
2723 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2663 2724
   * @param {Object} request
2664 2725
   *   The request object that will be sent.
2665 2726
   * @param {string} request.parent
@@ -2717,7 +2778,18 @@
Loading
2717 2778
   * @param {object} [options]
2718 2779
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2719 2780
   * @returns {Object}
2720 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
2781 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
2782 +
   *   When you iterate the returned iterable, each element will be an object representing
2783 +
   *   [Operation]{@link google.longrunning.Operation}. The API will be called under the hood as needed, once per the page,
2784 +
   *   so you can stop the iteration when you don't need more results.
2785 +
   *   Please see the
2786 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2787 +
   *   for more details and examples.
2788 +
   * @example
2789 +
   * const iterable = client.listDatabaseOperationsAsync(request);
2790 +
   * for await (const response of iterable) {
2791 +
   *   // process response
2792 +
   * }
2721 2793
   */
2722 2794
  listDatabaseOperationsAsync(
2723 2795
    request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest,
@@ -2840,19 +2912,14 @@
Loading
2840 2912
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2841 2913
   * @returns {Promise} - The promise which resolves to an array.
2842 2914
   *   The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
2843 -
   *   The client library support auto-pagination by default: it will call the API as many
2915 +
   *   The client library will perform auto-pagination by default: it will call the API as many
2844 2916
   *   times as needed and will merge results from all the pages into this array.
2845 -
   *
2846 -
   *   When autoPaginate: false is specified through options, the array has three elements.
2847 -
   *   The first element is Array of [Operation]{@link google.longrunning.Operation} that corresponds to
2848 -
   *   the one page received from the API server.
2849 -
   *   If the second element is not null it contains the request object of type [ListBackupOperationsRequest]{@link google.spanner.admin.database.v1.ListBackupOperationsRequest}
2850 -
   *   that can be used to obtain the next page of the results.
2851 -
   *   If it is null, the next page does not exist.
2852 -
   *   The third element contains the raw response received from the API server. Its type is
2853 -
   *   [ListBackupOperationsResponse]{@link google.spanner.admin.database.v1.ListBackupOperationsResponse}.
2854 -
   *
2855 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
2917 +
   *   Note that it can affect your quota.
2918 +
   *   We recommend using `listBackupOperationsAsync()`
2919 +
   *   method described below for async iteration which you can stop as needed.
2920 +
   *   Please see the
2921 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2922 +
   *   for more details and examples.
2856 2923
   */
2857 2924
  listBackupOperations(
2858 2925
    request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest,
@@ -2900,18 +2967,7 @@
Loading
2900 2967
  }
2901 2968
2902 2969
  /**
2903 -
   * Equivalent to {@link listBackupOperations}, but returns a NodeJS Stream object.
2904 -
   *
2905 -
   * This fetches the paged responses for {@link listBackupOperations} continuously
2906 -
   * and invokes the callback registered for 'data' event for each element in the
2907 -
   * responses.
2908 -
   *
2909 -
   * The returned object has 'end' method when no more elements are required.
2910 -
   *
2911 -
   * autoPaginate option will be ignored.
2912 -
   *
2913 -
   * @see {@link https://nodejs.org/api/stream.html}
2914 -
   *
2970 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
2915 2971
   * @param {Object} request
2916 2972
   *   The request object that will be sent.
2917 2973
   * @param {string} request.parent
@@ -2968,6 +3024,13 @@
Loading
2968 3024
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2969 3025
   * @returns {Stream}
2970 3026
   *   An object stream which emits an object representing [Operation]{@link google.longrunning.Operation} on 'data' event.
3027 +
   *   The client library will perform auto-pagination by default: it will call the API as many
3028 +
   *   times as needed. Note that it can affect your quota.
3029 +
   *   We recommend using `listBackupOperationsAsync()`
3030 +
   *   method described below for async iteration which you can stop as needed.
3031 +
   *   Please see the
3032 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
3033 +
   *   for more details and examples.
2971 3034
   */
2972 3035
  listBackupOperationsStream(
2973 3036
    request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest,
@@ -2992,10 +3055,9 @@
Loading
2992 3055
  }
2993 3056
2994 3057
  /**
2995 -
   * Equivalent to {@link listBackupOperations}, but returns an iterable object.
2996 -
   *
2997 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
3058 +
   * Equivalent to `listBackupOperations`, but returns an iterable object.
2998 3059
   *
3060 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2999 3061
   * @param {Object} request
3000 3062
   *   The request object that will be sent.
3001 3063
   * @param {string} request.parent
@@ -3051,7 +3113,18 @@
Loading
3051 3113
   * @param {object} [options]
3052 3114
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
3053 3115
   * @returns {Object}
3054 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
3116 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
3117 +
   *   When you iterate the returned iterable, each element will be an object representing
3118 +
   *   [Operation]{@link google.longrunning.Operation}. The API will be called under the hood as needed, once per the page,
3119 +
   *   so you can stop the iteration when you don't need more results.
3120 +
   *   Please see the
3121 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
3122 +
   *   for more details and examples.
3123 +
   * @example
3124 +
   * const iterable = client.listBackupOperationsAsync(request);
3125 +
   * for await (const response of iterable) {
3126 +
   *   // process response
3127 +
   * }
3055 3128
   */
3056 3129
  listBackupOperationsAsync(
3057 3130
    request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest,
@@ -3214,9 +3287,10 @@
Loading
3214 3287
  }
3215 3288
3216 3289
  /**
3217 -
   * Terminate the GRPC channel and close the client.
3290 +
   * Terminate the gRPC channel and close the client.
3218 3291
   *
3219 3292
   * The client will no longer be usable and all future behavior is undefined.
3293 +
   * @returns {Promise} A promise that resolves when the client is closed.
3220 3294
   */
3221 3295
  close(): Promise<void> {
3222 3296
    this.initialize();

@@ -63,8 +63,10 @@
Loading
63 63
  /**
64 64
   * Construct an instance of SpannerClient.
65 65
   *
66 -
   * @param {object} [options] - The configuration object. See the subsequent
67 -
   *   parameters for more details.
66 +
   * @param {object} [options] - The configuration object.
67 +
   * The options accepted by the constructor are described in detail
68 +
   * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
69 +
   * The common options are:
68 70
   * @param {object} [options.credentials] - Credentials object.
69 71
   * @param {string} [options.credentials.client_email]
70 72
   * @param {string} [options.credentials.private_key]
@@ -84,42 +86,33 @@
Loading
84 86
   *     your project ID will be detected automatically.
85 87
   * @param {string} [options.apiEndpoint] - The domain name of the
86 88
   *     API remote host.
89 +
   * @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
90 +
   *     TODO(@alexander-fenster): link to gax documentation.
91 +
   * @param {boolean} fallback - Use HTTP fallback mode.
92 +
   *     In fallback mode, a special browser-compatible transport implementation is used
93 +
   *     instead of gRPC transport. In browser context (if the `window` object is defined)
94 +
   *     the fallback mode is enabled automatically; set `options.fallback` to `false`
95 +
   *     if you need to override this behavior.
87 96
   */
88 -
89 97
  constructor(opts?: ClientOptions) {
90 -
    // Ensure that options include the service address and port.
98 +
    // Ensure that options include all the required fields.
91 99
    const staticMembers = this.constructor as typeof SpannerClient;
92 100
    const servicePath =
93 -
      opts && opts.servicePath
94 -
        ? opts.servicePath
95 -
        : opts && opts.apiEndpoint
96 -
        ? opts.apiEndpoint
97 -
        : staticMembers.servicePath;
98 -
    const port = opts && opts.port ? opts.port : staticMembers.port;
101 +
      opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
102 +
    const port = opts?.port || staticMembers.port;
103 +
    const clientConfig = opts?.clientConfig ?? {};
104 +
    const fallback = opts?.fallback ?? typeof window !== 'undefined';
105 +
    opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
99 106
100 -
    if (!opts) {
101 -
      opts = {servicePath, port};
107 +
    // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
108 +
    if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
109 +
      opts['scopes'] = staticMembers.scopes;
102 110
    }
103 -
    opts.servicePath = opts.servicePath || servicePath;
104 -
    opts.port = opts.port || port;
105 -
106 -
    // users can override the config from client side, like retry codes name.
107 -
    // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
108 -
    // The way to override client config for Showcase API:
109 -
    //
110 -
    // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
111 -
    // const showcaseClient = new showcaseClient({ projectId, customConfig });
112 -
    opts.clientConfig = opts.clientConfig || {};
113 111
114 -
    // If we're running in browser, it's OK to omit `fallback` since
115 -
    // google-gax has `browser` field in its `package.json`.
116 -
    // For Electron (which does not respect `browser` field),
117 -
    // pass `{fallback: true}` to the SpannerClient constructor.
112 +
    // Choose either gRPC or proto-over-HTTP implementation of google-gax.
118 113
    this._gaxModule = opts.fallback ? gax.fallback : gax;
119 114
120 -
    // Create a `gaxGrpc` object, with any grpc-specific options
121 -
    // sent to the client.
122 -
    opts.scopes = (this.constructor as typeof SpannerClient).scopes;
115 +
    // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
123 116
    this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
124 117
125 118
    // Save options to use in initialize() method.
@@ -128,6 +121,11 @@
Loading
128 121
    // Save the auth object to the client, for use by other methods.
129 122
    this.auth = this._gaxGrpc.auth as gax.GoogleAuth;
130 123
124 +
    // Set the default scopes in auth client if needed.
125 +
    if (servicePath === staticMembers.servicePath) {
126 +
      this.auth.defaultScopes = staticMembers.scopes;
127 +
    }
128 +
131 129
    // Determine the client header string.
132 130
    const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
133 131
    if (typeof process !== 'undefined' && 'versions' in process) {
@@ -287,6 +285,7 @@
Loading
287 285
288 286
  /**
289 287
   * The DNS address for this API service.
288 +
   * @returns {string} The DNS address for this service.
290 289
   */
291 290
  static get servicePath() {
292 291
    return 'spanner.googleapis.com';
@@ -295,6 +294,7 @@
Loading
295 294
  /**
296 295
   * The DNS address for this API service - same as servicePath(),
297 296
   * exists for compatibility reasons.
297 +
   * @returns {string} The DNS address for this service.
298 298
   */
299 299
  static get apiEndpoint() {
300 300
    return 'spanner.googleapis.com';
@@ -302,6 +302,7 @@
Loading
302 302
303 303
  /**
304 304
   * The port for this API service.
305 +
   * @returns {number} The default port for this service.
305 306
   */
306 307
  static get port() {
307 308
    return 443;
@@ -310,6 +311,7 @@
Loading
310 311
  /**
311 312
   * The scopes needed to make gRPC calls for every method defined
312 313
   * in this service.
314 +
   * @returns {string[]} List of default scopes.
313 315
   */
314 316
  static get scopes() {
315 317
    return [
@@ -322,8 +324,7 @@
Loading
322 324
  getProjectId(callback: Callback<string, undefined, undefined>): void;
323 325
  /**
324 326
   * Return the project ID used by this class.
325 -
   * @param {function(Error, string)} callback - the callback to
326 -
   *   be called with the current project Id.
327 +
   * @returns {Promise} A promise that resolves to string containing the project ID.
327 328
   */
328 329
  getProjectId(
329 330
    callback?: Callback<string, undefined, undefined>
@@ -396,7 +397,11 @@
Loading
396 397
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
397 398
   * @returns {Promise} - The promise which resolves to an array.
398 399
   *   The first element of the array is an object representing [Session]{@link google.spanner.v1.Session}.
399 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
400 +
   *   Please see the
401 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
402 +
   *   for more details and examples.
403 +
   * @example
404 +
   * const [response] = await client.createSession(request);
400 405
   */
401 406
  createSession(
402 407
    request: protos.google.spanner.v1.ICreateSessionRequest,
@@ -487,7 +492,11 @@
Loading
487 492
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
488 493
   * @returns {Promise} - The promise which resolves to an array.
489 494
   *   The first element of the array is an object representing [BatchCreateSessionsResponse]{@link google.spanner.v1.BatchCreateSessionsResponse}.
490 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
495 +
   *   Please see the
496 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
497 +
   *   for more details and examples.
498 +
   * @example
499 +
   * const [response] = await client.batchCreateSessions(request);
491 500
   */
492 501
  batchCreateSessions(
493 502
    request: protos.google.spanner.v1.IBatchCreateSessionsRequest,
@@ -571,7 +580,11 @@
Loading
571 580
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
572 581
   * @returns {Promise} - The promise which resolves to an array.
573 582
   *   The first element of the array is an object representing [Session]{@link google.spanner.v1.Session}.
574 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
583 +
   *   Please see the
584 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
585 +
   *   for more details and examples.
586 +
   * @example
587 +
   * const [response] = await client.getSession(request);
575 588
   */
576 589
  getSession(
577 590
    request: protos.google.spanner.v1.IGetSessionRequest,
@@ -653,7 +666,11 @@
Loading
653 666
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
654 667
   * @returns {Promise} - The promise which resolves to an array.
655 668
   *   The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
656 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
669 +
   *   Please see the
670 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
671 +
   *   for more details and examples.
672 +
   * @example
673 +
   * const [response] = await client.deleteSession(request);
657 674
   */
658 675
  deleteSession(
659 676
    request: protos.google.spanner.v1.IDeleteSessionRequest,
@@ -807,7 +824,11 @@
Loading
807 824
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
808 825
   * @returns {Promise} - The promise which resolves to an array.
809 826
   *   The first element of the array is an object representing [ResultSet]{@link google.spanner.v1.ResultSet}.
810 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
827 +
   *   Please see the
828 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
829 +
   *   for more details and examples.
830 +
   * @example
831 +
   * const [response] = await client.executeSql(request);
811 832
   */
812 833
  executeSql(
813 834
    request: protos.google.spanner.v1.IExecuteSqlRequest,
@@ -919,7 +940,11 @@
Loading
919 940
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
920 941
   * @returns {Promise} - The promise which resolves to an array.
921 942
   *   The first element of the array is an object representing [ExecuteBatchDmlResponse]{@link google.spanner.v1.ExecuteBatchDmlResponse}.
922 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
943 +
   *   Please see the
944 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
945 +
   *   for more details and examples.
946 +
   * @example
947 +
   * const [response] = await client.executeBatchDml(request);
923 948
   */
924 949
  executeBatchDml(
925 950
    request: protos.google.spanner.v1.IExecuteBatchDmlRequest,
@@ -1052,7 +1077,11 @@
Loading
1052 1077
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1053 1078
   * @returns {Promise} - The promise which resolves to an array.
1054 1079
   *   The first element of the array is an object representing [ResultSet]{@link google.spanner.v1.ResultSet}.
1055 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1080 +
   *   Please see the
1081 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1082 +
   *   for more details and examples.
1083 +
   * @example
1084 +
   * const [response] = await client.read(request);
1056 1085
   */
1057 1086
  read(
1058 1087
    request: protos.google.spanner.v1.IReadRequest,
@@ -1137,7 +1166,11 @@
Loading
1137 1166
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1138 1167
   * @returns {Promise} - The promise which resolves to an array.
1139 1168
   *   The first element of the array is an object representing [Transaction]{@link google.spanner.v1.Transaction}.
1140 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1169 +
   *   Please see the
1170 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1171 +
   *   for more details and examples.
1172 +
   * @example
1173 +
   * const [response] = await client.beginTransaction(request);
1141 1174
   */
1142 1175
  beginTransaction(
1143 1176
    request: protos.google.spanner.v1.IBeginTransactionRequest,
@@ -1240,7 +1273,11 @@
Loading
1240 1273
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1241 1274
   * @returns {Promise} - The promise which resolves to an array.
1242 1275
   *   The first element of the array is an object representing [CommitResponse]{@link google.spanner.v1.CommitResponse}.
1243 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1276 +
   *   Please see the
1277 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1278 +
   *   for more details and examples.
1279 +
   * @example
1280 +
   * const [response] = await client.commit(request);
1244 1281
   */
1245 1282
  commit(
1246 1283
    request: protos.google.spanner.v1.ICommitRequest,
@@ -1329,7 +1366,11 @@
Loading
1329 1366
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1330 1367
   * @returns {Promise} - The promise which resolves to an array.
1331 1368
   *   The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
1332 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1369 +
   *   Please see the
1370 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1371 +
   *   for more details and examples.
1372 +
   * @example
1373 +
   * const [response] = await client.rollback(request);
1333 1374
   */
1334 1375
  rollback(
1335 1376
    request: protos.google.spanner.v1.IRollbackRequest,
@@ -1457,7 +1498,11 @@
Loading
1457 1498
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1458 1499
   * @returns {Promise} - The promise which resolves to an array.
1459 1500
   *   The first element of the array is an object representing [PartitionResponse]{@link google.spanner.v1.PartitionResponse}.
1460 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1501 +
   *   Please see the
1502 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1503 +
   *   for more details and examples.
1504 +
   * @example
1505 +
   * const [response] = await client.partitionQuery(request);
1461 1506
   */
1462 1507
  partitionQuery(
1463 1508
    request: protos.google.spanner.v1.IPartitionQueryRequest,
@@ -1571,7 +1616,11 @@
Loading
1571 1616
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1572 1617
   * @returns {Promise} - The promise which resolves to an array.
1573 1618
   *   The first element of the array is an object representing [PartitionResponse]{@link google.spanner.v1.PartitionResponse}.
1574 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1619 +
   *   Please see the
1620 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
1621 +
   *   for more details and examples.
1622 +
   * @example
1623 +
   * const [response] = await client.partitionRead(request);
1575 1624
   */
1576 1625
  partitionRead(
1577 1626
    request: protos.google.spanner.v1.IPartitionReadRequest,
@@ -1693,6 +1742,13 @@
Loading
1693 1742
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1694 1743
   * @returns {Stream}
1695 1744
   *   An object stream which emits [PartialResultSet]{@link google.spanner.v1.PartialResultSet} on 'data' event.
1745 +
   *   Please see the
1746 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming)
1747 +
   *   for more details and examples.
1748 +
   * @example
1749 +
   * const stream = client.executeStreamingSql(request);
1750 +
   * stream.on('data', (response) => { ... });
1751 +
   * stream.on('end', () => { ... });
1696 1752
   */
1697 1753
  executeStreamingSql(
1698 1754
    request?: protos.google.spanner.v1.IExecuteSqlRequest,
@@ -1767,6 +1823,13 @@
Loading
1767 1823
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1768 1824
   * @returns {Stream}
1769 1825
   *   An object stream which emits [PartialResultSet]{@link google.spanner.v1.PartialResultSet} on 'data' event.
1826 +
   *   Please see the
1827 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming)
1828 +
   *   for more details and examples.
1829 +
   * @example
1830 +
   * const stream = client.streamingRead(request);
1831 +
   * stream.on('data', (response) => { ... });
1832 +
   * stream.on('end', () => { ... });
1770 1833
   */
1771 1834
  streamingRead(
1772 1835
    request?: protos.google.spanner.v1.IReadRequest,
@@ -1841,19 +1904,14 @@
Loading
1841 1904
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1842 1905
   * @returns {Promise} - The promise which resolves to an array.
1843 1906
   *   The first element of the array is Array of [Session]{@link google.spanner.v1.Session}.
1844 -
   *   The client library support auto-pagination by default: it will call the API as many
1907 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1845 1908
   *   times as needed and will merge results from all the pages into this array.
1846 -
   *
1847 -
   *   When autoPaginate: false is specified through options, the array has three elements.
1848 -
   *   The first element is Array of [Session]{@link google.spanner.v1.Session} that corresponds to
1849 -
   *   the one page received from the API server.
1850 -
   *   If the second element is not null it contains the request object of type [ListSessionsRequest]{@link google.spanner.v1.ListSessionsRequest}
1851 -
   *   that can be used to obtain the next page of the results.
1852 -
   *   If it is null, the next page does not exist.
1853 -
   *   The third element contains the raw response received from the API server. Its type is
1854 -
   *   [ListSessionsResponse]{@link google.spanner.v1.ListSessionsResponse}.
1855 -
   *
1856 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1909 +
   *   Note that it can affect your quota.
1910 +
   *   We recommend using `listSessionsAsync()`
1911 +
   *   method described below for async iteration which you can stop as needed.
1912 +
   *   Please see the
1913 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1914 +
   *   for more details and examples.
1857 1915
   */
1858 1916
  listSessions(
1859 1917
    request: protos.google.spanner.v1.IListSessionsRequest,
@@ -1897,18 +1955,7 @@
Loading
1897 1955
  }
1898 1956
1899 1957
  /**
1900 -
   * Equivalent to {@link listSessions}, but returns a NodeJS Stream object.
1901 -
   *
1902 -
   * This fetches the paged responses for {@link listSessions} continuously
1903 -
   * and invokes the callback registered for 'data' event for each element in the
1904 -
   * responses.
1905 -
   *
1906 -
   * The returned object has 'end' method when no more elements are required.
1907 -
   *
1908 -
   * autoPaginate option will be ignored.
1909 -
   *
1910 -
   * @see {@link https://nodejs.org/api/stream.html}
1911 -
   *
1958 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1912 1959
   * @param {Object} request
1913 1960
   *   The request object that will be sent.
1914 1961
   * @param {string} request.database
@@ -1935,6 +1982,13 @@
Loading
1935 1982
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1936 1983
   * @returns {Stream}
1937 1984
   *   An object stream which emits an object representing [Session]{@link google.spanner.v1.Session} on 'data' event.
1985 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1986 +
   *   times as needed. Note that it can affect your quota.
1987 +
   *   We recommend using `listSessionsAsync()`
1988 +
   *   method described below for async iteration which you can stop as needed.
1989 +
   *   Please see the
1990 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1991 +
   *   for more details and examples.
1938 1992
   */
1939 1993
  listSessionsStream(
1940 1994
    request?: protos.google.spanner.v1.IListSessionsRequest,
@@ -1959,10 +2013,9 @@
Loading
1959 2013
  }
1960 2014
1961 2015
  /**
1962 -
   * Equivalent to {@link listSessions}, but returns an iterable object.
1963 -
   *
1964 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
2016 +
   * Equivalent to `listSessions`, but returns an iterable object.
1965 2017
   *
2018 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1966 2019
   * @param {Object} request
1967 2020
   *   The request object that will be sent.
1968 2021
   * @param {string} request.database
@@ -1988,7 +2041,18 @@
Loading
1988 2041
   * @param {object} [options]
1989 2042
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1990 2043
   * @returns {Object}
1991 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
2044 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
2045 +
   *   When you iterate the returned iterable, each element will be an object representing
2046 +
   *   [Session]{@link google.spanner.v1.Session}. The API will be called under the hood as needed, once per the page,
2047 +
   *   so you can stop the iteration when you don't need more results.
2048 +
   *   Please see the
2049 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
2050 +
   *   for more details and examples.
2051 +
   * @example
2052 +
   * const iterable = client.listSessionsAsync(request);
2053 +
   * for await (const response of iterable) {
2054 +
   *   // process response
2055 +
   * }
1992 2056
   */
1993 2057
  listSessionsAsync(
1994 2058
    request?: protos.google.spanner.v1.IListSessionsRequest,
@@ -2133,9 +2197,10 @@
Loading
2133 2197
  }
2134 2198
2135 2199
  /**
2136 -
   * Terminate the GRPC channel and close the client.
2200 +
   * Terminate the gRPC channel and close the client.
2137 2201
   *
2138 2202
   * The client will no longer be usable and all future behavior is undefined.
2203 +
   * @returns {Promise} A promise that resolves when the client is closed.
2139 2204
   */
2140 2205
  close(): Promise<void> {
2141 2206
    this.initialize();

@@ -82,8 +82,10 @@
Loading
82 82
  /**
83 83
   * Construct an instance of InstanceAdminClient.
84 84
   *
85 -
   * @param {object} [options] - The configuration object. See the subsequent
86 -
   *   parameters for more details.
85 +
   * @param {object} [options] - The configuration object.
86 +
   * The options accepted by the constructor are described in detail
87 +
   * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
88 +
   * The common options are:
87 89
   * @param {object} [options.credentials] - Credentials object.
88 90
   * @param {string} [options.credentials.client_email]
89 91
   * @param {string} [options.credentials.private_key]
@@ -103,42 +105,33 @@
Loading
103 105
   *     your project ID will be detected automatically.
104 106
   * @param {string} [options.apiEndpoint] - The domain name of the
105 107
   *     API remote host.
108 +
   * @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
109 +
   *     TODO(@alexander-fenster): link to gax documentation.
110 +
   * @param {boolean} fallback - Use HTTP fallback mode.
111 +
   *     In fallback mode, a special browser-compatible transport implementation is used
112 +
   *     instead of gRPC transport. In browser context (if the `window` object is defined)
113 +
   *     the fallback mode is enabled automatically; set `options.fallback` to `false`
114 +
   *     if you need to override this behavior.
106 115
   */
107 -
108 116
  constructor(opts?: ClientOptions) {
109 -
    // Ensure that options include the service address and port.
117 +
    // Ensure that options include all the required fields.
110 118
    const staticMembers = this.constructor as typeof InstanceAdminClient;
111 119
    const servicePath =
112 -
      opts && opts.servicePath
113 -
        ? opts.servicePath
114 -
        : opts && opts.apiEndpoint
115 -
        ? opts.apiEndpoint
116 -
        : staticMembers.servicePath;
117 -
    const port = opts && opts.port ? opts.port : staticMembers.port;
120 +
      opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
121 +
    const port = opts?.port || staticMembers.port;
122 +
    const clientConfig = opts?.clientConfig ?? {};
123 +
    const fallback = opts?.fallback ?? typeof window !== 'undefined';
124 +
    opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
118 125
119 -
    if (!opts) {
120 -
      opts = {servicePath, port};
126 +
    // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
127 +
    if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
128 +
      opts['scopes'] = staticMembers.scopes;
121 129
    }
122 -
    opts.servicePath = opts.servicePath || servicePath;
123 -
    opts.port = opts.port || port;
124 -
125 -
    // users can override the config from client side, like retry codes name.
126 -
    // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
127 -
    // The way to override client config for Showcase API:
128 -
    //
129 -
    // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
130 -
    // const showcaseClient = new showcaseClient({ projectId, customConfig });
131 -
    opts.clientConfig = opts.clientConfig || {};
132 130
133 -
    // If we're running in browser, it's OK to omit `fallback` since
134 -
    // google-gax has `browser` field in its `package.json`.
135 -
    // For Electron (which does not respect `browser` field),
136 -
    // pass `{fallback: true}` to the InstanceAdminClient constructor.
131 +
    // Choose either gRPC or proto-over-HTTP implementation of google-gax.
137 132
    this._gaxModule = opts.fallback ? gax.fallback : gax;
138 133
139 -
    // Create a `gaxGrpc` object, with any grpc-specific options
140 -
    // sent to the client.
141 -
    opts.scopes = (this.constructor as typeof InstanceAdminClient).scopes;
134 +
    // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
142 135
    this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
143 136
144 137
    // Save options to use in initialize() method.
@@ -147,6 +140,11 @@
Loading
147 140
    // Save the auth object to the client, for use by other methods.
148 141
    this.auth = this._gaxGrpc.auth as gax.GoogleAuth;
149 142
143 +
    // Set the default scopes in auth client if needed.
144 +
    if (servicePath === staticMembers.servicePath) {
145 +
      this.auth.defaultScopes = staticMembers.scopes;
146 +
    }
147 +
150 148
    // Determine the client header string.
151 149
    const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
152 150
    if (typeof process !== 'undefined' && 'versions' in process) {
@@ -340,6 +338,7 @@
Loading
340 338
341 339
  /**
342 340
   * The DNS address for this API service.
341 +
   * @returns {string} The DNS address for this service.
343 342
   */
344 343
  static get servicePath() {
345 344
    return 'spanner.googleapis.com';
@@ -348,6 +347,7 @@
Loading
348 347
  /**
349 348
   * The DNS address for this API service - same as servicePath(),
350 349
   * exists for compatibility reasons.
350 +
   * @returns {string} The DNS address for this service.
351 351
   */
352 352
  static get apiEndpoint() {
353 353
    return 'spanner.googleapis.com';
@@ -355,6 +355,7 @@
Loading
355 355
356 356
  /**
357 357
   * The port for this API service.
358 +
   * @returns {number} The default port for this service.
358 359
   */
359 360
  static get port() {
360 361
    return 443;
@@ -363,6 +364,7 @@
Loading
363 364
  /**
364 365
   * The scopes needed to make gRPC calls for every method defined
365 366
   * in this service.
367 +
   * @returns {string[]} List of default scopes.
366 368
   */
367 369
  static get scopes() {
368 370
    return [
@@ -375,8 +377,7 @@
Loading
375 377
  getProjectId(callback: Callback<string, undefined, undefined>): void;
376 378
  /**
377 379
   * Return the project ID used by this class.
378 -
   * @param {function(Error, string)} callback - the callback to
379 -
   *   be called with the current project Id.
380 +
   * @returns {Promise} A promise that resolves to string containing the project ID.
380 381
   */
381 382
  getProjectId(
382 383
    callback?: Callback<string, undefined, undefined>
@@ -437,7 +438,11 @@
Loading
437 438
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
438 439
   * @returns {Promise} - The promise which resolves to an array.
439 440
   *   The first element of the array is an object representing [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}.
440 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
441 +
   *   Please see the
442 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
443 +
   *   for more details and examples.
444 +
   * @example
445 +
   * const [response] = await client.getInstanceConfig(request);
441 446
   */
442 447
  getInstanceConfig(
443 448
    request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest,
@@ -533,7 +538,11 @@
Loading
533 538
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
534 539
   * @returns {Promise} - The promise which resolves to an array.
535 540
   *   The first element of the array is an object representing [Instance]{@link google.spanner.admin.instance.v1.Instance}.
536 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
541 +
   *   Please see the
542 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
543 +
   *   for more details and examples.
544 +
   * @example
545 +
   * const [response] = await client.getInstance(request);
537 546
   */
538 547
  getInstance(
539 548
    request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest,
@@ -635,7 +644,11 @@
Loading
635 644
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
636 645
   * @returns {Promise} - The promise which resolves to an array.
637 646
   *   The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
638 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
647 +
   *   Please see the
648 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
649 +
   *   for more details and examples.
650 +
   * @example
651 +
   * const [response] = await client.deleteInstance(request);
639 652
   */
640 653
  deleteInstance(
641 654
    request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest,
@@ -732,7 +745,11 @@
Loading
732 745
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
733 746
   * @returns {Promise} - The promise which resolves to an array.
734 747
   *   The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
735 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
748 +
   *   Please see the
749 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
750 +
   *   for more details and examples.
751 +
   * @example
752 +
   * const [response] = await client.setIamPolicy(request);
736 753
   */
737 754
  setIamPolicy(
738 755
    request: protos.google.iam.v1.ISetIamPolicyRequest,
@@ -820,7 +837,11 @@
Loading
820 837
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
821 838
   * @returns {Promise} - The promise which resolves to an array.
822 839
   *   The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
823 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
840 +
   *   Please see the
841 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
842 +
   *   for more details and examples.
843 +
   * @example
844 +
   * const [response] = await client.getIamPolicy(request);
824 845
   */
825 846
  getIamPolicy(
826 847
    request: protos.google.iam.v1.IGetIamPolicyRequest,
@@ -911,7 +932,11 @@
Loading
911 932
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
912 933
   * @returns {Promise} - The promise which resolves to an array.
913 934
   *   The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
914 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
935 +
   *   Please see the
936 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
937 +
   *   for more details and examples.
938 +
   * @example
939 +
   * const [response] = await client.testIamPermissions(request);
915 940
   */
916 941
  testIamPermissions(
917 942
    request: protos.google.iam.v1.ITestIamPermissionsRequest,
@@ -1041,8 +1066,15 @@
Loading
1041 1066
   * @param {object} [options]
1042 1067
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1043 1068
   * @returns {Promise} - The promise which resolves to an array.
1044 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1045 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1069 +
   *   The first element of the array is an object representing
1070 +
   *   a long running operation. Its `promise()` method returns a promise
1071 +
   *   you can `await` for.
1072 +
   *   Please see the
1073 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1074 +
   *   for more details and examples.
1075 +
   * @example
1076 +
   * const [operation] = await client.createInstance(request);
1077 +
   * const [response] = await operation.promise();
1046 1078
   */
1047 1079
  createInstance(
1048 1080
    request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest,
@@ -1094,18 +1126,19 @@
Loading
1094 1126
    return this.innerApiCalls.createInstance(request, options, callback);
1095 1127
  }
1096 1128
  /**
1097 -
   * Check the status of the long running operation returned by the createInstance() method.
1129 +
   * Check the status of the long running operation returned by `createInstance()`.
1098 1130
   * @param {String} name
1099 1131
   *   The operation name that will be passed.
1100 1132
   * @returns {Promise} - The promise which resolves to an object.
1101 1133
   *   The decoded operation object has result and metadata field to get information from.
1102 -
   *
1103 -
   * @example:
1104 -
   *   const decodedOperation = await checkCreateInstanceProgress(name);
1105 -
   *   console.log(decodedOperation.result);
1106 -
   *   console.log(decodedOperation.done);
1107 -
   *   console.log(decodedOperation.metadata);
1108 -
   *
1134 +
   *   Please see the
1135 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1136 +
   *   for more details and examples.
1137 +
   * @example
1138 +
   * const decodedOperation = await checkCreateInstanceProgress(name);
1139 +
   * console.log(decodedOperation.result);
1140 +
   * console.log(decodedOperation.done);
1141 +
   * console.log(decodedOperation.metadata);
1109 1142
   */
1110 1143
  async checkCreateInstanceProgress(
1111 1144
    name: string
@@ -1220,8 +1253,15 @@
Loading
1220 1253
   * @param {object} [options]
1221 1254
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1222 1255
   * @returns {Promise} - The promise which resolves to an array.
1223 -
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1224 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1256 +
   *   The first element of the array is an object representing
1257 +
   *   a long running operation. Its `promise()` method returns a promise
1258 +
   *   you can `await` for.
1259 +
   *   Please see the
1260 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1261 +
   *   for more details and examples.
1262 +
   * @example
1263 +
   * const [operation] = await client.updateInstance(request);
1264 +
   * const [response] = await operation.promise();
1225 1265
   */
1226 1266
  updateInstance(
1227 1267
    request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest,
@@ -1273,18 +1313,19 @@
Loading
1273 1313
    return this.innerApiCalls.updateInstance(request, options, callback);
1274 1314
  }
1275 1315
  /**
1276 -
   * Check the status of the long running operation returned by the updateInstance() method.
1316 +
   * Check the status of the long running operation returned by `updateInstance()`.
1277 1317
   * @param {String} name
1278 1318
   *   The operation name that will be passed.
1279 1319
   * @returns {Promise} - The promise which resolves to an object.
1280 1320
   *   The decoded operation object has result and metadata field to get information from.
1281 -
   *
1282 -
   * @example:
1283 -
   *   const decodedOperation = await checkUpdateInstanceProgress(name);
1284 -
   *   console.log(decodedOperation.result);
1285 -
   *   console.log(decodedOperation.done);
1286 -
   *   console.log(decodedOperation.metadata);
1287 -
   *
1321 +
   *   Please see the
1322 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1323 +
   *   for more details and examples.
1324 +
   * @example
1325 +
   * const decodedOperation = await checkUpdateInstanceProgress(name);
1326 +
   * console.log(decodedOperation.result);
1327 +
   * console.log(decodedOperation.done);
1328 +
   * console.log(decodedOperation.metadata);
1288 1329
   */
1289 1330
  async checkUpdateInstanceProgress(
1290 1331
    name: string
@@ -1359,19 +1400,14 @@
Loading
1359 1400
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1360 1401
   * @returns {Promise} - The promise which resolves to an array.
1361 1402
   *   The first element of the array is Array of [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}.
1362 -
   *   The client library support auto-pagination by default: it will call the API as many
1403 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1363 1404
   *   times as needed and will merge results from all the pages into this array.
1364 -
   *
1365 -
   *   When autoPaginate: false is specified through options, the array has three elements.
1366 -
   *   The first element is Array of [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig} that corresponds to
1367 -
   *   the one page received from the API server.
1368 -
   *   If the second element is not null it contains the request object of type [ListInstanceConfigsRequest]{@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest}
1369 -
   *   that can be used to obtain the next page of the results.
1370 -
   *   If it is null, the next page does not exist.
1371 -
   *   The third element contains the raw response received from the API server. Its type is
1372 -
   *   [ListInstanceConfigsResponse]{@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse}.
1373 -
   *
1374 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1405 +
   *   Note that it can affect your quota.
1406 +
   *   We recommend using `listInstanceConfigsAsync()`
1407 +
   *   method described below for async iteration which you can stop as needed.
1408 +
   *   Please see the
1409 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1410 +
   *   for more details and examples.
1375 1411
   */
1376 1412
  listInstanceConfigs(
1377 1413
    request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest,
@@ -1419,18 +1455,7 @@
Loading
1419 1455
  }
1420 1456
1421 1457
  /**
1422 -
   * Equivalent to {@link listInstanceConfigs}, but returns a NodeJS Stream object.
1423 -
   *
1424 -
   * This fetches the paged responses for {@link listInstanceConfigs} continuously
1425 -
   * and invokes the callback registered for 'data' event for each element in the
1426 -
   * responses.
1427 -
   *
1428 -
   * The returned object has 'end' method when no more elements are required.
1429 -
   *
1430 -
   * autoPaginate option will be ignored.
1431 -
   *
1432 -
   * @see {@link https://nodejs.org/api/stream.html}
1433 -
   *
1458 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1434 1459
   * @param {Object} request
1435 1460
   *   The request object that will be sent.
1436 1461
   * @param {string} request.parent
@@ -1448,6 +1473,13 @@
Loading
1448 1473
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1449 1474
   * @returns {Stream}
1450 1475
   *   An object stream which emits an object representing [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig} on 'data' event.
1476 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1477 +
   *   times as needed. Note that it can affect your quota.
1478 +
   *   We recommend using `listInstanceConfigsAsync()`
1479 +
   *   method described below for async iteration which you can stop as needed.
1480 +
   *   Please see the
1481 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1482 +
   *   for more details and examples.
1451 1483
   */
1452 1484
  listInstanceConfigsStream(
1453 1485
    request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest,
@@ -1472,10 +1504,9 @@
Loading
1472 1504
  }
1473 1505
1474 1506
  /**
1475 -
   * Equivalent to {@link listInstanceConfigs}, but returns an iterable object.
1476 -
   *
1477 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
1507 +
   * Equivalent to `listInstanceConfigs`, but returns an iterable object.
1478 1508
   *
1509 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1479 1510
   * @param {Object} request
1480 1511
   *   The request object that will be sent.
1481 1512
   * @param {string} request.parent
@@ -1492,7 +1523,18 @@
Loading
1492 1523
   * @param {object} [options]
1493 1524
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1494 1525
   * @returns {Object}
1495 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1526 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
1527 +
   *   When you iterate the returned iterable, each element will be an object representing
1528 +
   *   [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}. The API will be called under the hood as needed, once per the page,
1529 +
   *   so you can stop the iteration when you don't need more results.
1530 +
   *   Please see the
1531 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1532 +
   *   for more details and examples.
1533 +
   * @example
1534 +
   * const iterable = client.listInstanceConfigsAsync(request);
1535 +
   * for await (const response of iterable) {
1536 +
   *   // process response
1537 +
   * }
1496 1538
   */
1497 1539
  listInstanceConfigsAsync(
1498 1540
    request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest,
@@ -1586,19 +1628,14 @@
Loading
1586 1628
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1587 1629
   * @returns {Promise} - The promise which resolves to an array.
1588 1630
   *   The first element of the array is Array of [Instance]{@link google.spanner.admin.instance.v1.Instance}.
1589 -
   *   The client library support auto-pagination by default: it will call the API as many
1631 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1590 1632
   *   times as needed and will merge results from all the pages into this array.
1591 -
   *
1592 -
   *   When autoPaginate: false is specified through options, the array has three elements.
1593 -
   *   The first element is Array of [Instance]{@link google.spanner.admin.instance.v1.Instance} that corresponds to
1594 -
   *   the one page received from the API server.
1595 -
   *   If the second element is not null it contains the request object of type [ListInstancesRequest]{@link google.spanner.admin.instance.v1.ListInstancesRequest}
1596 -
   *   that can be used to obtain the next page of the results.
1597 -
   *   If it is null, the next page does not exist.
1598 -
   *   The third element contains the raw response received from the API server. Its type is
1599 -
   *   [ListInstancesResponse]{@link google.spanner.admin.instance.v1.ListInstancesResponse}.
1600 -
   *
1601 -
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1633 +
   *   Note that it can affect your quota.
1634 +
   *   We recommend using `listInstancesAsync()`
1635 +
   *   method described below for async iteration which you can stop as needed.
1636 +
   *   Please see the
1637 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1638 +
   *   for more details and examples.
1602 1639
   */
1603 1640
  listInstances(
1604 1641
    request: protos.google.spanner.admin.instance.v1.IListInstancesRequest,
@@ -1646,18 +1683,7 @@
Loading
1646 1683
  }
1647 1684
1648 1685
  /**
1649 -
   * Equivalent to {@link listInstances}, but returns a NodeJS Stream object.
1650 -
   *
1651 -
   * This fetches the paged responses for {@link listInstances} continuously
1652 -
   * and invokes the callback registered for 'data' event for each element in the
1653 -
   * responses.
1654 -
   *
1655 -
   * The returned object has 'end' method when no more elements are required.
1656 -
   *
1657 -
   * autoPaginate option will be ignored.
1658 -
   *
1659 -
   * @see {@link https://nodejs.org/api/stream.html}
1660 -
   *
1686 +
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1661 1687
   * @param {Object} request
1662 1688
   *   The request object that will be sent.
1663 1689
   * @param {string} request.parent
@@ -1694,6 +1720,13 @@
Loading
1694 1720
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1695 1721
   * @returns {Stream}
1696 1722
   *   An object stream which emits an object representing [Instance]{@link google.spanner.admin.instance.v1.Instance} on 'data' event.
1723 +
   *   The client library will perform auto-pagination by default: it will call the API as many
1724 +
   *   times as needed. Note that it can affect your quota.
1725 +
   *   We recommend using `listInstancesAsync()`
1726 +
   *   method described below for async iteration which you can stop as needed.
1727 +
   *   Please see the
1728 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1729 +
   *   for more details and examples.
1697 1730
   */
1698 1731
  listInstancesStream(
1699 1732
    request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest,
@@ -1718,10 +1751,9 @@
Loading
1718 1751
  }
1719 1752
1720 1753
  /**
1721 -
   * Equivalent to {@link listInstances}, but returns an iterable object.
1722 -
   *
1723 -
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
1754 +
   * Equivalent to `listInstances`, but returns an iterable object.
1724 1755
   *
1756 +
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1725 1757
   * @param {Object} request
1726 1758
   *   The request object that will be sent.
1727 1759
   * @param {string} request.parent
@@ -1757,7 +1789,18 @@
Loading
1757 1789
   * @param {object} [options]
1758 1790
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1759 1791
   * @returns {Object}
1760 -
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1792 +
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
1793 +
   *   When you iterate the returned iterable, each element will be an object representing
1794 +
   *   [Instance]{@link google.spanner.admin.instance.v1.Instance}. The API will be called under the hood as needed, once per the page,
1795 +
   *   so you can stop the iteration when you don't need more results.
1796 +
   *   Please see the
1797 +
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1798 +
   *   for more details and examples.
1799 +
   * @example
1800 +
   * const iterable = client.listInstancesAsync(request);
1801 +
   * for await (const response of iterable) {
1802 +
   *   // process response
1803 +
   * }
1761 1804
   */
1762 1805
  listInstancesAsync(
1763 1806
    request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest,
@@ -1885,9 +1928,10 @@
Loading
1885 1928
  }
1886 1929
1887 1930
  /**
1888 -
   * Terminate the GRPC channel and close the client.
1931 +
   * Terminate the gRPC channel and close the client.
1889 1932
   *
1890 1933
   * The client will no longer be usable and all future behavior is undefined.
1934 +
   * @returns {Promise} A promise that resolves when the client is closed.
1891 1935
   */
1892 1936
  close(): Promise<void> {
1893 1937
    this.initialize();
Files Coverage
bin 0.00%
src 99.73%
.mocharc.js 79.31%
.prettierrc.js 0.00%
Project Totals (23 files) 98.60%
actions 15
Build #361858302 -
actions 12
Build #361858302 -
actions 14
Build #361858302 -
actions 10
Build #361858302 -
actions windows
Build #361858302 -

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading