@google-cloud/spanner 7.18.0 → 7.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +757 -0
  4. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +230 -0
  5. package/build/protos/google/spanner/admin/database/v1/common.proto +132 -0
  6. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1209 -0
  7. package/build/protos/google/spanner/admin/instance/v1/common.proto +64 -0
  8. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +2110 -0
  9. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1520 -0
  10. package/build/protos/google/spanner/v1/commit_response.proto +59 -0
  11. package/build/protos/google/spanner/v1/keys.proto +163 -0
  12. package/build/protos/google/spanner/v1/mutation.proto +107 -0
  13. package/build/protos/google/spanner/v1/query_plan.proto +128 -0
  14. package/build/protos/google/spanner/v1/result_set.proto +237 -0
  15. package/build/protos/google/spanner/v1/spanner.proto +1389 -0
  16. package/build/protos/google/spanner/v1/transaction.proto +575 -0
  17. package/build/protos/google/spanner/v1/type.proto +214 -0
  18. package/build/protos/protos.d.ts +39317 -0
  19. package/build/protos/protos.js +100360 -0
  20. package/build/protos/protos.json +10271 -0
  21. package/build/src/backup.d.ts +349 -0
  22. package/build/src/backup.js +246 -0
  23. package/build/src/batch-transaction.d.ts +247 -0
  24. package/build/src/batch-transaction.js +384 -0
  25. package/build/src/codec.d.ts +362 -0
  26. package/build/src/codec.js +791 -0
  27. package/build/src/common-grpc/service-object.d.ts +80 -0
  28. package/build/src/common-grpc/service-object.js +101 -0
  29. package/build/src/common-grpc/service.d.ts +445 -0
  30. package/build/src/common-grpc/service.js +826 -0
  31. package/build/src/common.d.ts +66 -0
  32. package/build/src/common.js +54 -0
  33. package/build/src/database.d.ts +2103 -0
  34. package/build/src/database.js +1655 -0
  35. package/build/src/extra_proto_list.json +1 -0
  36. package/build/src/helper.d.ts +45 -0
  37. package/build/src/helper.js +71 -0
  38. package/build/src/index.d.ts +1195 -0
  39. package/build/src/index.js +1059 -0
  40. package/build/src/instance-config.d.ts +294 -0
  41. package/build/src/instance-config.js +216 -0
  42. package/build/src/instance.d.ts +832 -0
  43. package/build/src/instance.js +781 -0
  44. package/build/src/instrument.d.ts +85 -0
  45. package/build/src/instrument.js +215 -0
  46. package/build/src/multiplexed-session.d.ts +136 -0
  47. package/build/src/multiplexed-session.js +197 -0
  48. package/build/src/partial-result-stream.d.ts +253 -0
  49. package/build/src/partial-result-stream.js +400 -0
  50. package/build/src/session-factory.d.ts +100 -0
  51. package/build/src/session-factory.js +93 -0
  52. package/build/src/session-pool.d.ts +471 -0
  53. package/build/src/session-pool.js +754 -0
  54. package/build/src/session.d.ts +258 -0
  55. package/build/src/session.js +348 -0
  56. package/build/src/spanner_grpc_config.json +92 -0
  57. package/build/src/table.d.ts +831 -0
  58. package/build/src/table.js +277 -0
  59. package/build/src/transaction-runner.d.ts +185 -0
  60. package/build/src/transaction-runner.js +282 -0
  61. package/build/src/transaction.d.ts +1691 -0
  62. package/build/src/transaction.js +2004 -0
  63. package/build/src/v1/database_admin_client.d.ts +2301 -0
  64. package/build/src/v1/database_admin_client.js +2286 -0
  65. package/build/src/v1/database_admin_client_config.json +160 -0
  66. package/build/src/v1/database_admin_proto_list.json +6 -0
  67. package/build/src/v1/gapic_metadata.json +27 -0
  68. package/build/src/v1/index.d.ts +4 -0
  69. package/build/src/v1/index.js +29 -0
  70. package/build/src/v1/instance_admin_client.d.ts +1985 -0
  71. package/build/src/v1/instance_admin_client.js +1768 -0
  72. package/build/src/v1/instance_admin_client_config.json +129 -0
  73. package/build/src/v1/instance_admin_proto_list.json +4 -0
  74. package/build/src/v1/spanner_client.d.ts +1250 -0
  75. package/build/src/v1/spanner_client.js +1086 -0
  76. package/build/src/v1/spanner_client_config.json +119 -0
  77. package/build/src/v1/spanner_executor_proxy_client.d.ts +418 -0
  78. package/build/src/v1/spanner_executor_proxy_client.js +706 -0
  79. package/build/src/v1/spanner_executor_proxy_client_config.json +30 -0
  80. package/build/src/v1/spanner_executor_proxy_proto_list.json +14 -0
  81. package/build/src/v1/spanner_proto_list.json +10 -0
  82. package/package.json +1 -1
@@ -0,0 +1,2286 @@
1
+ "use strict";
2
+ // Copyright 2025 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.DatabaseAdminClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/database_admin_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./database_admin_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Cloud Spanner Database Admin API
31
+ *
32
+ * The Cloud Spanner Database Admin API can be used to:
33
+ * * create, drop, and list databases
34
+ * * update the schema of pre-existing databases
35
+ * * create, delete, copy and list backups for a database
36
+ * * restore a database from an existing backup
37
+ * @class
38
+ * @memberof v1
39
+ */
40
+ class DatabaseAdminClient {
41
+ /**
42
+ * Construct an instance of DatabaseAdminClient.
43
+ *
44
+ * @param {object} [options] - The configuration object.
45
+ * The options accepted by the constructor are described in detail
46
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
47
+ * The common options are:
48
+ * @param {object} [options.credentials] - Credentials object.
49
+ * @param {string} [options.credentials.client_email]
50
+ * @param {string} [options.credentials.private_key]
51
+ * @param {string} [options.email] - Account email address. Required when
52
+ * using a .pem or .p12 keyFilename.
53
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
54
+ * .p12 key downloaded from the Google Developers Console. If you provide
55
+ * a path to a JSON file, the projectId option below is not necessary.
56
+ * NOTE: .pem and .p12 require you to specify options.email as well.
57
+ * @param {number} [options.port] - The port on which to connect to
58
+ * the remote host.
59
+ * @param {string} [options.projectId] - The project ID from the Google
60
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
61
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
62
+ * app is running in an environment which supports
63
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
64
+ * your project ID will be detected automatically.
65
+ * @param {string} [options.apiEndpoint] - The domain name of the
66
+ * API remote host.
67
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
68
+ * Follows the structure of {@link gapicConfig}.
69
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
70
+ * For more information, please check the
71
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
72
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
73
+ * need to avoid loading the default gRPC version and want to use the fallback
74
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
75
+ * ```
76
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
77
+ * const client = new DatabaseAdminClient({fallback: true}, gax);
78
+ * ```
79
+ */
80
+ constructor(opts, gaxInstance) {
81
+ var _a, _b, _c, _d, _e;
82
+ this._terminated = false;
83
+ this.descriptors = {
84
+ page: {},
85
+ stream: {},
86
+ longrunning: {},
87
+ batching: {},
88
+ };
89
+ // Ensure that options include all the required fields.
90
+ const staticMembers = this.constructor;
91
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
92
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
93
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
94
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
95
+ }
96
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
97
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
98
+ : undefined;
99
+ this._universeDomain =
100
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
101
+ this._servicePath = 'spanner.' + this._universeDomain;
102
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
103
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
104
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
105
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
106
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
107
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
108
+ // Request numeric enum values if REST transport is used.
109
+ opts.numericEnums = true;
110
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
111
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
112
+ opts['scopes'] = staticMembers.scopes;
113
+ }
114
+ // Load google-gax module synchronously if needed
115
+ if (!gaxInstance) {
116
+ gaxInstance = require('google-gax');
117
+ }
118
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
119
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
120
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
121
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
122
+ // Save options to use in initialize() method.
123
+ this._opts = opts;
124
+ // Save the auth object to the client, for use by other methods.
125
+ this.auth = this._gaxGrpc.auth;
126
+ // Set useJWTAccessWithScope on the auth object.
127
+ this.auth.useJWTAccessWithScope = true;
128
+ // Set defaultServicePath on the auth object.
129
+ this.auth.defaultServicePath = this._servicePath;
130
+ // Set the default scopes in auth client if needed.
131
+ if (servicePath === this._servicePath) {
132
+ this.auth.defaultScopes = staticMembers.scopes;
133
+ }
134
+ // Determine the client header string.
135
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
136
+ if (typeof process === 'object' && 'versions' in process) {
137
+ clientHeader.push(`gl-node/${process.versions.node}`);
138
+ }
139
+ else {
140
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
141
+ }
142
+ if (!opts.fallback) {
143
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
144
+ }
145
+ else {
146
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
147
+ }
148
+ if (opts.libName && opts.libVersion) {
149
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
150
+ }
151
+ // Load the applicable protos.
152
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
153
+ // This API contains "path templates"; forward-slash-separated
154
+ // identifiers to uniquely identify resources within the API.
155
+ // Create useful helper objects for these.
156
+ this.pathTemplates = {
157
+ backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
158
+ backupSchedulePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}'),
159
+ cryptoKeyPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'),
160
+ databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
161
+ databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
162
+ instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
163
+ };
164
+ // Some of the methods on this service return "paged" results,
165
+ // (e.g. 50 results at a time, with tokens to get subsequent
166
+ // pages). Denote the keys used for pagination and results.
167
+ this.descriptors.page = {
168
+ listDatabases: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases'),
169
+ listBackups: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'),
170
+ listDatabaseOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
171
+ listBackupOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
172
+ listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
173
+ listBackupSchedules: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules'),
174
+ };
175
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
176
+ // This API contains "long-running operations", which return a
177
+ // an Operation object that allows for tracking of the operation,
178
+ // rather than holding a request open.
179
+ const lroOptions = {
180
+ auth: this.auth,
181
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
182
+ };
183
+ if (opts.fallback) {
184
+ lroOptions.protoJson = protoFilesRoot;
185
+ lroOptions.httpRules = [
186
+ {
187
+ selector: 'google.longrunning.Operations.CancelOperation',
188
+ post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
189
+ additional_bindings: [
190
+ { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
191
+ {
192
+ post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',
193
+ },
194
+ {
195
+ post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',
196
+ },
197
+ ],
198
+ },
199
+ {
200
+ selector: 'google.longrunning.Operations.DeleteOperation',
201
+ delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
202
+ additional_bindings: [
203
+ { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
204
+ {
205
+ delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',
206
+ },
207
+ { delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
208
+ ],
209
+ },
210
+ {
211
+ selector: 'google.longrunning.Operations.GetOperation',
212
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
213
+ additional_bindings: [
214
+ { get: '/v1/{name=projects/*/instances/*/operations/*}' },
215
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}' },
216
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
217
+ ],
218
+ },
219
+ {
220
+ selector: 'google.longrunning.Operations.ListOperations',
221
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
222
+ additional_bindings: [
223
+ { get: '/v1/{name=projects/*/instances/*/operations}' },
224
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations}' },
225
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations}' },
226
+ ],
227
+ },
228
+ ];
229
+ }
230
+ this.operationsClient = this._gaxModule
231
+ .lro(lroOptions)
232
+ .operationsClient(opts);
233
+ const createDatabaseResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Database');
234
+ const createDatabaseMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CreateDatabaseMetadata');
235
+ const updateDatabaseResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Database');
236
+ const updateDatabaseMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.UpdateDatabaseMetadata');
237
+ const updateDatabaseDdlResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
238
+ const updateDatabaseDdlMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata');
239
+ const createBackupResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Backup');
240
+ const createBackupMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CreateBackupMetadata');
241
+ const copyBackupResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Backup');
242
+ const copyBackupMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CopyBackupMetadata');
243
+ const restoreDatabaseResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Database');
244
+ const restoreDatabaseMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.RestoreDatabaseMetadata');
245
+ this.descriptors.longrunning = {
246
+ createDatabase: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createDatabaseResponse.decode.bind(createDatabaseResponse), createDatabaseMetadata.decode.bind(createDatabaseMetadata)),
247
+ updateDatabase: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateDatabaseResponse.decode.bind(updateDatabaseResponse), updateDatabaseMetadata.decode.bind(updateDatabaseMetadata)),
248
+ updateDatabaseDdl: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateDatabaseDdlResponse.decode.bind(updateDatabaseDdlResponse), updateDatabaseDdlMetadata.decode.bind(updateDatabaseDdlMetadata)),
249
+ createBackup: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createBackupResponse.decode.bind(createBackupResponse), createBackupMetadata.decode.bind(createBackupMetadata)),
250
+ copyBackup: new this._gaxModule.LongrunningDescriptor(this.operationsClient, copyBackupResponse.decode.bind(copyBackupResponse), copyBackupMetadata.decode.bind(copyBackupMetadata)),
251
+ restoreDatabase: new this._gaxModule.LongrunningDescriptor(this.operationsClient, restoreDatabaseResponse.decode.bind(restoreDatabaseResponse), restoreDatabaseMetadata.decode.bind(restoreDatabaseMetadata)),
252
+ };
253
+ // Put together the default options sent with requests.
254
+ this._defaults = this._gaxGrpc.constructSettings('google.spanner.admin.database.v1.DatabaseAdmin', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
255
+ // Set up a dictionary of "inner API calls"; the core implementation
256
+ // of calling the API is handled in `google-gax`, with this code
257
+ // merely providing the destination and request information.
258
+ this.innerApiCalls = {};
259
+ // Add a warn function to the client constructor so it can be easily tested.
260
+ this.warn = this._gaxModule.warn;
261
+ }
262
+ /**
263
+ * Initialize the client.
264
+ * Performs asynchronous operations (such as authentication) and prepares the client.
265
+ * This function will be called automatically when any class method is called for the
266
+ * first time, but if you need to initialize it before calling an actual method,
267
+ * feel free to call initialize() directly.
268
+ *
269
+ * You can await on this method if you want to make sure the client is initialized.
270
+ *
271
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
272
+ */
273
+ initialize() {
274
+ // If the client stub promise is already initialized, return immediately.
275
+ if (this.databaseAdminStub) {
276
+ return this.databaseAdminStub;
277
+ }
278
+ // Put together the "service stub" for
279
+ // google.spanner.admin.database.v1.DatabaseAdmin.
280
+ this.databaseAdminStub = this._gaxGrpc.createStub(this._opts.fallback
281
+ ? this._protos.lookupService('google.spanner.admin.database.v1.DatabaseAdmin')
282
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
283
+ this._protos.google.spanner.admin.database.v1.DatabaseAdmin, this._opts, this._providedCustomServicePath);
284
+ // Iterate over each of the methods that the service provides
285
+ // and create an API call method for each.
286
+ const databaseAdminStubMethods = [
287
+ 'listDatabases',
288
+ 'createDatabase',
289
+ 'getDatabase',
290
+ 'updateDatabase',
291
+ 'updateDatabaseDdl',
292
+ 'dropDatabase',
293
+ 'getDatabaseDdl',
294
+ 'setIamPolicy',
295
+ 'getIamPolicy',
296
+ 'testIamPermissions',
297
+ 'createBackup',
298
+ 'copyBackup',
299
+ 'getBackup',
300
+ 'updateBackup',
301
+ 'deleteBackup',
302
+ 'listBackups',
303
+ 'restoreDatabase',
304
+ 'listDatabaseOperations',
305
+ 'listBackupOperations',
306
+ 'listDatabaseRoles',
307
+ 'createBackupSchedule',
308
+ 'getBackupSchedule',
309
+ 'updateBackupSchedule',
310
+ 'deleteBackupSchedule',
311
+ 'listBackupSchedules',
312
+ ];
313
+ for (const methodName of databaseAdminStubMethods) {
314
+ const callPromise = this.databaseAdminStub.then(stub => (...args) => {
315
+ if (this._terminated) {
316
+ return Promise.reject('The client has already been closed.');
317
+ }
318
+ const func = stub[methodName];
319
+ return func.apply(stub, args);
320
+ }, (err) => () => {
321
+ throw err;
322
+ });
323
+ const descriptor = this.descriptors.page[methodName] ||
324
+ this.descriptors.longrunning[methodName] ||
325
+ undefined;
326
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
327
+ this.innerApiCalls[methodName] = apiCall;
328
+ }
329
+ return this.databaseAdminStub;
330
+ }
331
+ /**
332
+ * The DNS address for this API service.
333
+ * @deprecated Use the apiEndpoint method of the client instance.
334
+ * @returns {string} The DNS address for this service.
335
+ */
336
+ static get servicePath() {
337
+ if (typeof process === 'object' &&
338
+ typeof process.emitWarning === 'function') {
339
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
340
+ }
341
+ return 'spanner.googleapis.com';
342
+ }
343
+ /**
344
+ * The DNS address for this API service - same as servicePath.
345
+ * @deprecated Use the apiEndpoint method of the client instance.
346
+ * @returns {string} The DNS address for this service.
347
+ */
348
+ static get apiEndpoint() {
349
+ if (typeof process === 'object' &&
350
+ typeof process.emitWarning === 'function') {
351
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
352
+ }
353
+ return 'spanner.googleapis.com';
354
+ }
355
+ /**
356
+ * The DNS address for this API service.
357
+ * @returns {string} The DNS address for this service.
358
+ */
359
+ get apiEndpoint() {
360
+ return this._servicePath;
361
+ }
362
+ get universeDomain() {
363
+ return this._universeDomain;
364
+ }
365
+ /**
366
+ * The port for this API service.
367
+ * @returns {number} The default port for this service.
368
+ */
369
+ static get port() {
370
+ return 443;
371
+ }
372
+ /**
373
+ * The scopes needed to make gRPC calls for every method defined
374
+ * in this service.
375
+ * @returns {string[]} List of default scopes.
376
+ */
377
+ static get scopes() {
378
+ return [
379
+ 'https://www.googleapis.com/auth/cloud-platform',
380
+ 'https://www.googleapis.com/auth/spanner.admin',
381
+ ];
382
+ }
383
+ /**
384
+ * Return the project ID used by this class.
385
+ * @returns {Promise} A promise that resolves to string containing the project ID.
386
+ */
387
+ getProjectId(callback) {
388
+ if (callback) {
389
+ this.auth.getProjectId(callback);
390
+ return;
391
+ }
392
+ return this.auth.getProjectId();
393
+ }
394
+ getDatabase(request, optionsOrCallback, callback) {
395
+ var _a;
396
+ request = request || {};
397
+ let options;
398
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
399
+ callback = optionsOrCallback;
400
+ options = {};
401
+ }
402
+ else {
403
+ options = optionsOrCallback;
404
+ }
405
+ options = options || {};
406
+ options.otherArgs = options.otherArgs || {};
407
+ options.otherArgs.headers = options.otherArgs.headers || {};
408
+ options.otherArgs.headers['x-goog-request-params'] =
409
+ this._gaxModule.routingHeader.fromParams({
410
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
411
+ });
412
+ this.initialize();
413
+ return this.innerApiCalls.getDatabase(request, options, callback);
414
+ }
415
+ dropDatabase(request, optionsOrCallback, callback) {
416
+ var _a;
417
+ request = request || {};
418
+ let options;
419
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
420
+ callback = optionsOrCallback;
421
+ options = {};
422
+ }
423
+ else {
424
+ options = optionsOrCallback;
425
+ }
426
+ options = options || {};
427
+ options.otherArgs = options.otherArgs || {};
428
+ options.otherArgs.headers = options.otherArgs.headers || {};
429
+ options.otherArgs.headers['x-goog-request-params'] =
430
+ this._gaxModule.routingHeader.fromParams({
431
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
432
+ });
433
+ this.initialize();
434
+ return this.innerApiCalls.dropDatabase(request, options, callback);
435
+ }
436
+ getDatabaseDdl(request, optionsOrCallback, callback) {
437
+ var _a;
438
+ request = request || {};
439
+ let options;
440
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
441
+ callback = optionsOrCallback;
442
+ options = {};
443
+ }
444
+ else {
445
+ options = optionsOrCallback;
446
+ }
447
+ options = options || {};
448
+ options.otherArgs = options.otherArgs || {};
449
+ options.otherArgs.headers = options.otherArgs.headers || {};
450
+ options.otherArgs.headers['x-goog-request-params'] =
451
+ this._gaxModule.routingHeader.fromParams({
452
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
453
+ });
454
+ this.initialize();
455
+ return this.innerApiCalls.getDatabaseDdl(request, options, callback);
456
+ }
457
+ setIamPolicy(request, optionsOrCallback, callback) {
458
+ var _a;
459
+ request = request || {};
460
+ let options;
461
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
462
+ callback = optionsOrCallback;
463
+ options = {};
464
+ }
465
+ else {
466
+ options = optionsOrCallback;
467
+ }
468
+ options = options || {};
469
+ options.otherArgs = options.otherArgs || {};
470
+ options.otherArgs.headers = options.otherArgs.headers || {};
471
+ options.otherArgs.headers['x-goog-request-params'] =
472
+ this._gaxModule.routingHeader.fromParams({
473
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
474
+ });
475
+ this.initialize();
476
+ return this.innerApiCalls.setIamPolicy(request, options, callback);
477
+ }
478
+ getIamPolicy(request, optionsOrCallback, callback) {
479
+ var _a;
480
+ request = request || {};
481
+ let options;
482
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
483
+ callback = optionsOrCallback;
484
+ options = {};
485
+ }
486
+ else {
487
+ options = optionsOrCallback;
488
+ }
489
+ options = options || {};
490
+ options.otherArgs = options.otherArgs || {};
491
+ options.otherArgs.headers = options.otherArgs.headers || {};
492
+ options.otherArgs.headers['x-goog-request-params'] =
493
+ this._gaxModule.routingHeader.fromParams({
494
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
495
+ });
496
+ this.initialize();
497
+ return this.innerApiCalls.getIamPolicy(request, options, callback);
498
+ }
499
+ testIamPermissions(request, optionsOrCallback, callback) {
500
+ var _a;
501
+ request = request || {};
502
+ let options;
503
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
504
+ callback = optionsOrCallback;
505
+ options = {};
506
+ }
507
+ else {
508
+ options = optionsOrCallback;
509
+ }
510
+ options = options || {};
511
+ options.otherArgs = options.otherArgs || {};
512
+ options.otherArgs.headers = options.otherArgs.headers || {};
513
+ options.otherArgs.headers['x-goog-request-params'] =
514
+ this._gaxModule.routingHeader.fromParams({
515
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
516
+ });
517
+ this.initialize();
518
+ return this.innerApiCalls.testIamPermissions(request, options, callback);
519
+ }
520
+ getBackup(request, optionsOrCallback, callback) {
521
+ var _a;
522
+ request = request || {};
523
+ let options;
524
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
525
+ callback = optionsOrCallback;
526
+ options = {};
527
+ }
528
+ else {
529
+ options = optionsOrCallback;
530
+ }
531
+ options = options || {};
532
+ options.otherArgs = options.otherArgs || {};
533
+ options.otherArgs.headers = options.otherArgs.headers || {};
534
+ options.otherArgs.headers['x-goog-request-params'] =
535
+ this._gaxModule.routingHeader.fromParams({
536
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
537
+ });
538
+ this.initialize();
539
+ return this.innerApiCalls.getBackup(request, options, callback);
540
+ }
541
+ updateBackup(request, optionsOrCallback, callback) {
542
+ var _a;
543
+ request = request || {};
544
+ let options;
545
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
546
+ callback = optionsOrCallback;
547
+ options = {};
548
+ }
549
+ else {
550
+ options = optionsOrCallback;
551
+ }
552
+ options = options || {};
553
+ options.otherArgs = options.otherArgs || {};
554
+ options.otherArgs.headers = options.otherArgs.headers || {};
555
+ options.otherArgs.headers['x-goog-request-params'] =
556
+ this._gaxModule.routingHeader.fromParams({
557
+ 'backup.name': (_a = request.backup.name) !== null && _a !== void 0 ? _a : '',
558
+ });
559
+ this.initialize();
560
+ return this.innerApiCalls.updateBackup(request, options, callback);
561
+ }
562
+ deleteBackup(request, optionsOrCallback, callback) {
563
+ var _a;
564
+ request = request || {};
565
+ let options;
566
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
567
+ callback = optionsOrCallback;
568
+ options = {};
569
+ }
570
+ else {
571
+ options = optionsOrCallback;
572
+ }
573
+ options = options || {};
574
+ options.otherArgs = options.otherArgs || {};
575
+ options.otherArgs.headers = options.otherArgs.headers || {};
576
+ options.otherArgs.headers['x-goog-request-params'] =
577
+ this._gaxModule.routingHeader.fromParams({
578
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
579
+ });
580
+ this.initialize();
581
+ return this.innerApiCalls.deleteBackup(request, options, callback);
582
+ }
583
+ createBackupSchedule(request, optionsOrCallback, callback) {
584
+ var _a;
585
+ request = request || {};
586
+ let options;
587
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
588
+ callback = optionsOrCallback;
589
+ options = {};
590
+ }
591
+ else {
592
+ options = optionsOrCallback;
593
+ }
594
+ options = options || {};
595
+ options.otherArgs = options.otherArgs || {};
596
+ options.otherArgs.headers = options.otherArgs.headers || {};
597
+ options.otherArgs.headers['x-goog-request-params'] =
598
+ this._gaxModule.routingHeader.fromParams({
599
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
600
+ });
601
+ this.initialize();
602
+ return this.innerApiCalls.createBackupSchedule(request, options, callback);
603
+ }
604
+ getBackupSchedule(request, optionsOrCallback, callback) {
605
+ var _a;
606
+ request = request || {};
607
+ let options;
608
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
609
+ callback = optionsOrCallback;
610
+ options = {};
611
+ }
612
+ else {
613
+ options = optionsOrCallback;
614
+ }
615
+ options = options || {};
616
+ options.otherArgs = options.otherArgs || {};
617
+ options.otherArgs.headers = options.otherArgs.headers || {};
618
+ options.otherArgs.headers['x-goog-request-params'] =
619
+ this._gaxModule.routingHeader.fromParams({
620
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
621
+ });
622
+ this.initialize();
623
+ return this.innerApiCalls.getBackupSchedule(request, options, callback);
624
+ }
625
+ updateBackupSchedule(request, optionsOrCallback, callback) {
626
+ var _a;
627
+ request = request || {};
628
+ let options;
629
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
630
+ callback = optionsOrCallback;
631
+ options = {};
632
+ }
633
+ else {
634
+ options = optionsOrCallback;
635
+ }
636
+ options = options || {};
637
+ options.otherArgs = options.otherArgs || {};
638
+ options.otherArgs.headers = options.otherArgs.headers || {};
639
+ options.otherArgs.headers['x-goog-request-params'] =
640
+ this._gaxModule.routingHeader.fromParams({
641
+ 'backup_schedule.name': (_a = request.backupSchedule.name) !== null && _a !== void 0 ? _a : '',
642
+ });
643
+ this.initialize();
644
+ return this.innerApiCalls.updateBackupSchedule(request, options, callback);
645
+ }
646
+ deleteBackupSchedule(request, optionsOrCallback, callback) {
647
+ var _a;
648
+ request = request || {};
649
+ let options;
650
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
651
+ callback = optionsOrCallback;
652
+ options = {};
653
+ }
654
+ else {
655
+ options = optionsOrCallback;
656
+ }
657
+ options = options || {};
658
+ options.otherArgs = options.otherArgs || {};
659
+ options.otherArgs.headers = options.otherArgs.headers || {};
660
+ options.otherArgs.headers['x-goog-request-params'] =
661
+ this._gaxModule.routingHeader.fromParams({
662
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
663
+ });
664
+ this.initialize();
665
+ return this.innerApiCalls.deleteBackupSchedule(request, options, callback);
666
+ }
667
+ createDatabase(request, optionsOrCallback, callback) {
668
+ var _a;
669
+ request = request || {};
670
+ let options;
671
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
672
+ callback = optionsOrCallback;
673
+ options = {};
674
+ }
675
+ else {
676
+ options = optionsOrCallback;
677
+ }
678
+ options = options || {};
679
+ options.otherArgs = options.otherArgs || {};
680
+ options.otherArgs.headers = options.otherArgs.headers || {};
681
+ options.otherArgs.headers['x-goog-request-params'] =
682
+ this._gaxModule.routingHeader.fromParams({
683
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
684
+ });
685
+ this.initialize();
686
+ return this.innerApiCalls.createDatabase(request, options, callback);
687
+ }
688
+ /**
689
+ * Check the status of the long running operation returned by `createDatabase()`.
690
+ * @param {String} name
691
+ * The operation name that will be passed.
692
+ * @returns {Promise} - The promise which resolves to an object.
693
+ * The decoded operation object has result and metadata field to get information from.
694
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
695
+ * for more details and examples.
696
+ */
697
+ async checkCreateDatabaseProgress(name) {
698
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
699
+ const [operation] = await this.operationsClient.getOperation(request);
700
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
701
+ return decodeOperation;
702
+ }
703
+ updateDatabase(request, optionsOrCallback, callback) {
704
+ var _a;
705
+ request = request || {};
706
+ let options;
707
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
708
+ callback = optionsOrCallback;
709
+ options = {};
710
+ }
711
+ else {
712
+ options = optionsOrCallback;
713
+ }
714
+ options = options || {};
715
+ options.otherArgs = options.otherArgs || {};
716
+ options.otherArgs.headers = options.otherArgs.headers || {};
717
+ options.otherArgs.headers['x-goog-request-params'] =
718
+ this._gaxModule.routingHeader.fromParams({
719
+ 'database.name': (_a = request.database.name) !== null && _a !== void 0 ? _a : '',
720
+ });
721
+ this.initialize();
722
+ return this.innerApiCalls.updateDatabase(request, options, callback);
723
+ }
724
+ /**
725
+ * Check the status of the long running operation returned by `updateDatabase()`.
726
+ * @param {String} name
727
+ * The operation name that will be passed.
728
+ * @returns {Promise} - The promise which resolves to an object.
729
+ * The decoded operation object has result and metadata field to get information from.
730
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
731
+ * for more details and examples.
732
+ */
733
+ async checkUpdateDatabaseProgress(name) {
734
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
735
+ const [operation] = await this.operationsClient.getOperation(request);
736
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabase, this._gaxModule.createDefaultBackoffSettings());
737
+ return decodeOperation;
738
+ }
739
+ updateDatabaseDdl(request, optionsOrCallback, callback) {
740
+ var _a;
741
+ request = request || {};
742
+ let options;
743
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
744
+ callback = optionsOrCallback;
745
+ options = {};
746
+ }
747
+ else {
748
+ options = optionsOrCallback;
749
+ }
750
+ options = options || {};
751
+ options.otherArgs = options.otherArgs || {};
752
+ options.otherArgs.headers = options.otherArgs.headers || {};
753
+ options.otherArgs.headers['x-goog-request-params'] =
754
+ this._gaxModule.routingHeader.fromParams({
755
+ database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
756
+ });
757
+ this.initialize();
758
+ return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
759
+ }
760
+ /**
761
+ * Check the status of the long running operation returned by `updateDatabaseDdl()`.
762
+ * @param {String} name
763
+ * The operation name that will be passed.
764
+ * @returns {Promise} - The promise which resolves to an object.
765
+ * The decoded operation object has result and metadata field to get information from.
766
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
767
+ * for more details and examples.
768
+ */
769
+ async checkUpdateDatabaseDdlProgress(name) {
770
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
771
+ const [operation] = await this.operationsClient.getOperation(request);
772
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
773
+ return decodeOperation;
774
+ }
775
+ createBackup(request, optionsOrCallback, callback) {
776
+ var _a;
777
+ request = request || {};
778
+ let options;
779
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
780
+ callback = optionsOrCallback;
781
+ options = {};
782
+ }
783
+ else {
784
+ options = optionsOrCallback;
785
+ }
786
+ options = options || {};
787
+ options.otherArgs = options.otherArgs || {};
788
+ options.otherArgs.headers = options.otherArgs.headers || {};
789
+ options.otherArgs.headers['x-goog-request-params'] =
790
+ this._gaxModule.routingHeader.fromParams({
791
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
792
+ });
793
+ this.initialize();
794
+ return this.innerApiCalls.createBackup(request, options, callback);
795
+ }
796
+ /**
797
+ * Check the status of the long running operation returned by `createBackup()`.
798
+ * @param {String} name
799
+ * The operation name that will be passed.
800
+ * @returns {Promise} - The promise which resolves to an object.
801
+ * The decoded operation object has result and metadata field to get information from.
802
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
803
+ * for more details and examples.
804
+ */
805
+ async checkCreateBackupProgress(name) {
806
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
807
+ const [operation] = await this.operationsClient.getOperation(request);
808
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
809
+ return decodeOperation;
810
+ }
811
+ copyBackup(request, optionsOrCallback, callback) {
812
+ var _a;
813
+ request = request || {};
814
+ let options;
815
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
816
+ callback = optionsOrCallback;
817
+ options = {};
818
+ }
819
+ else {
820
+ options = optionsOrCallback;
821
+ }
822
+ options = options || {};
823
+ options.otherArgs = options.otherArgs || {};
824
+ options.otherArgs.headers = options.otherArgs.headers || {};
825
+ options.otherArgs.headers['x-goog-request-params'] =
826
+ this._gaxModule.routingHeader.fromParams({
827
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
828
+ });
829
+ this.initialize();
830
+ return this.innerApiCalls.copyBackup(request, options, callback);
831
+ }
832
+ /**
833
+ * Check the status of the long running operation returned by `copyBackup()`.
834
+ * @param {String} name
835
+ * The operation name that will be passed.
836
+ * @returns {Promise} - The promise which resolves to an object.
837
+ * The decoded operation object has result and metadata field to get information from.
838
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
839
+ * for more details and examples.
840
+ */
841
+ async checkCopyBackupProgress(name) {
842
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
843
+ const [operation] = await this.operationsClient.getOperation(request);
844
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
845
+ return decodeOperation;
846
+ }
847
+ restoreDatabase(request, optionsOrCallback, callback) {
848
+ var _a;
849
+ request = request || {};
850
+ let options;
851
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
852
+ callback = optionsOrCallback;
853
+ options = {};
854
+ }
855
+ else {
856
+ options = optionsOrCallback;
857
+ }
858
+ options = options || {};
859
+ options.otherArgs = options.otherArgs || {};
860
+ options.otherArgs.headers = options.otherArgs.headers || {};
861
+ options.otherArgs.headers['x-goog-request-params'] =
862
+ this._gaxModule.routingHeader.fromParams({
863
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
864
+ });
865
+ this.initialize();
866
+ return this.innerApiCalls.restoreDatabase(request, options, callback);
867
+ }
868
+ /**
869
+ * Check the status of the long running operation returned by `restoreDatabase()`.
870
+ * @param {String} name
871
+ * The operation name that will be passed.
872
+ * @returns {Promise} - The promise which resolves to an object.
873
+ * The decoded operation object has result and metadata field to get information from.
874
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
875
+ * for more details and examples.
876
+ */
877
+ async checkRestoreDatabaseProgress(name) {
878
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
879
+ const [operation] = await this.operationsClient.getOperation(request);
880
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
881
+ return decodeOperation;
882
+ }
883
+ listDatabases(request, optionsOrCallback, callback) {
884
+ var _a;
885
+ request = request || {};
886
+ let options;
887
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
888
+ callback = optionsOrCallback;
889
+ options = {};
890
+ }
891
+ else {
892
+ options = optionsOrCallback;
893
+ }
894
+ options = options || {};
895
+ options.otherArgs = options.otherArgs || {};
896
+ options.otherArgs.headers = options.otherArgs.headers || {};
897
+ options.otherArgs.headers['x-goog-request-params'] =
898
+ this._gaxModule.routingHeader.fromParams({
899
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
900
+ });
901
+ this.initialize();
902
+ return this.innerApiCalls.listDatabases(request, options, callback);
903
+ }
904
+ /**
905
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
906
+ * @param {Object} request
907
+ * The request object that will be sent.
908
+ * @param {string} request.parent
909
+ * Required. The instance whose databases should be listed.
910
+ * Values are of the form `projects/<project>/instances/<instance>`.
911
+ * @param {number} request.pageSize
912
+ * Number of databases to be returned in the response. If 0 or less,
913
+ * defaults to the server's maximum allowed page size.
914
+ * @param {string} request.pageToken
915
+ * If non-empty, `page_token` should contain a
916
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token}
917
+ * from a previous
918
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
919
+ * @param {object} [options]
920
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
921
+ * @returns {Stream}
922
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Database|Database} on 'data' event.
923
+ * The client library will perform auto-pagination by default: it will call the API as many
924
+ * times as needed. Note that it can affect your quota.
925
+ * We recommend using `listDatabasesAsync()`
926
+ * method described below for async iteration which you can stop as needed.
927
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
928
+ * for more details and examples.
929
+ */
930
+ listDatabasesStream(request, options) {
931
+ var _a;
932
+ request = request || {};
933
+ options = options || {};
934
+ options.otherArgs = options.otherArgs || {};
935
+ options.otherArgs.headers = options.otherArgs.headers || {};
936
+ options.otherArgs.headers['x-goog-request-params'] =
937
+ this._gaxModule.routingHeader.fromParams({
938
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
939
+ });
940
+ const defaultCallSettings = this._defaults['listDatabases'];
941
+ const callSettings = defaultCallSettings.merge(options);
942
+ this.initialize();
943
+ return this.descriptors.page.listDatabases.createStream(this.innerApiCalls.listDatabases, request, callSettings);
944
+ }
945
+ /**
946
+ * Equivalent to `listDatabases`, but returns an iterable object.
947
+ *
948
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
949
+ * @param {Object} request
950
+ * The request object that will be sent.
951
+ * @param {string} request.parent
952
+ * Required. The instance whose databases should be listed.
953
+ * Values are of the form `projects/<project>/instances/<instance>`.
954
+ * @param {number} request.pageSize
955
+ * Number of databases to be returned in the response. If 0 or less,
956
+ * defaults to the server's maximum allowed page size.
957
+ * @param {string} request.pageToken
958
+ * If non-empty, `page_token` should contain a
959
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token}
960
+ * from a previous
961
+ * {@link protos.google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
962
+ * @param {object} [options]
963
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
964
+ * @returns {Object}
965
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
966
+ * When you iterate the returned iterable, each element will be an object representing
967
+ * {@link protos.google.spanner.admin.database.v1.Database|Database}. The API will be called under the hood as needed, once per the page,
968
+ * so you can stop the iteration when you don't need more results.
969
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
970
+ * for more details and examples.
971
+ */
972
+ listDatabasesAsync(request, options) {
973
+ var _a;
974
+ request = request || {};
975
+ options = options || {};
976
+ options.otherArgs = options.otherArgs || {};
977
+ options.otherArgs.headers = options.otherArgs.headers || {};
978
+ options.otherArgs.headers['x-goog-request-params'] =
979
+ this._gaxModule.routingHeader.fromParams({
980
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
981
+ });
982
+ const defaultCallSettings = this._defaults['listDatabases'];
983
+ const callSettings = defaultCallSettings.merge(options);
984
+ this.initialize();
985
+ return this.descriptors.page.listDatabases.asyncIterate(this.innerApiCalls['listDatabases'], request, callSettings);
986
+ }
987
+ listBackups(request, optionsOrCallback, callback) {
988
+ var _a;
989
+ request = request || {};
990
+ let options;
991
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
992
+ callback = optionsOrCallback;
993
+ options = {};
994
+ }
995
+ else {
996
+ options = optionsOrCallback;
997
+ }
998
+ options = options || {};
999
+ options.otherArgs = options.otherArgs || {};
1000
+ options.otherArgs.headers = options.otherArgs.headers || {};
1001
+ options.otherArgs.headers['x-goog-request-params'] =
1002
+ this._gaxModule.routingHeader.fromParams({
1003
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1004
+ });
1005
+ this.initialize();
1006
+ return this.innerApiCalls.listBackups(request, options, callback);
1007
+ }
1008
+ /**
1009
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1010
+ * @param {Object} request
1011
+ * The request object that will be sent.
1012
+ * @param {string} request.parent
1013
+ * Required. The instance to list backups from. Values are of the
1014
+ * form `projects/<project>/instances/<instance>`.
1015
+ * @param {string} request.filter
1016
+ * An expression that filters the list of returned backups.
1017
+ *
1018
+ * A filter expression consists of a field name, a comparison operator, and a
1019
+ * value for filtering.
1020
+ * The value must be a string, a number, or a boolean. The comparison operator
1021
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1022
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1023
+ *
1024
+ * The following fields in the
1025
+ * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for
1026
+ * filtering:
1027
+ *
1028
+ * * `name`
1029
+ * * `database`
1030
+ * * `state`
1031
+ * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1032
+ * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1033
+ * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1034
+ * * `size_bytes`
1035
+ * * `backup_schedules`
1036
+ *
1037
+ * You can combine multiple expressions by enclosing each expression in
1038
+ * parentheses. By default, expressions are combined with AND logic, but
1039
+ * you can specify AND, OR, and NOT logic explicitly.
1040
+ *
1041
+ * Here are a few examples:
1042
+ *
1043
+ * * `name:Howl` - The backup's name contains the string "howl".
1044
+ * * `database:prod`
1045
+ * - The database's name contains the string "prod".
1046
+ * * `state:CREATING` - The backup is pending creation.
1047
+ * * `state:READY` - The backup is fully created and ready for use.
1048
+ * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
1049
+ * - The backup name contains the string "howl" and `create_time`
1050
+ * of the backup is before 2018-03-28T14:50:00Z.
1051
+ * * `expire_time < \"2018-03-28T14:50:00Z\"`
1052
+ * - The backup `expire_time` is before 2018-03-28T14:50:00Z.
1053
+ * * `size_bytes > 10000000000` - The backup's size is greater than 10GB
1054
+ * * `backup_schedules:daily`
1055
+ * - The backup is created from a schedule with "daily" in its name.
1056
+ * @param {number} request.pageSize
1057
+ * Number of backups to be returned in the response. If 0 or
1058
+ * less, defaults to the server's maximum allowed page size.
1059
+ * @param {string} request.pageToken
1060
+ * If non-empty, `page_token` should contain a
1061
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token}
1062
+ * from a previous
1063
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse}
1064
+ * to the same `parent` and with the same `filter`.
1065
+ * @param {object} [options]
1066
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1067
+ * @returns {Stream}
1068
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup} on 'data' event.
1069
+ * The client library will perform auto-pagination by default: it will call the API as many
1070
+ * times as needed. Note that it can affect your quota.
1071
+ * We recommend using `listBackupsAsync()`
1072
+ * method described below for async iteration which you can stop as needed.
1073
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1074
+ * for more details and examples.
1075
+ */
1076
+ listBackupsStream(request, options) {
1077
+ var _a;
1078
+ request = request || {};
1079
+ options = options || {};
1080
+ options.otherArgs = options.otherArgs || {};
1081
+ options.otherArgs.headers = options.otherArgs.headers || {};
1082
+ options.otherArgs.headers['x-goog-request-params'] =
1083
+ this._gaxModule.routingHeader.fromParams({
1084
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1085
+ });
1086
+ const defaultCallSettings = this._defaults['listBackups'];
1087
+ const callSettings = defaultCallSettings.merge(options);
1088
+ this.initialize();
1089
+ return this.descriptors.page.listBackups.createStream(this.innerApiCalls.listBackups, request, callSettings);
1090
+ }
1091
+ /**
1092
+ * Equivalent to `listBackups`, but returns an iterable object.
1093
+ *
1094
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1095
+ * @param {Object} request
1096
+ * The request object that will be sent.
1097
+ * @param {string} request.parent
1098
+ * Required. The instance to list backups from. Values are of the
1099
+ * form `projects/<project>/instances/<instance>`.
1100
+ * @param {string} request.filter
1101
+ * An expression that filters the list of returned backups.
1102
+ *
1103
+ * A filter expression consists of a field name, a comparison operator, and a
1104
+ * value for filtering.
1105
+ * The value must be a string, a number, or a boolean. The comparison operator
1106
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1107
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1108
+ *
1109
+ * The following fields in the
1110
+ * {@link protos.google.spanner.admin.database.v1.Backup|Backup} are eligible for
1111
+ * filtering:
1112
+ *
1113
+ * * `name`
1114
+ * * `database`
1115
+ * * `state`
1116
+ * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1117
+ * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1118
+ * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
1119
+ * * `size_bytes`
1120
+ * * `backup_schedules`
1121
+ *
1122
+ * You can combine multiple expressions by enclosing each expression in
1123
+ * parentheses. By default, expressions are combined with AND logic, but
1124
+ * you can specify AND, OR, and NOT logic explicitly.
1125
+ *
1126
+ * Here are a few examples:
1127
+ *
1128
+ * * `name:Howl` - The backup's name contains the string "howl".
1129
+ * * `database:prod`
1130
+ * - The database's name contains the string "prod".
1131
+ * * `state:CREATING` - The backup is pending creation.
1132
+ * * `state:READY` - The backup is fully created and ready for use.
1133
+ * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
1134
+ * - The backup name contains the string "howl" and `create_time`
1135
+ * of the backup is before 2018-03-28T14:50:00Z.
1136
+ * * `expire_time < \"2018-03-28T14:50:00Z\"`
1137
+ * - The backup `expire_time` is before 2018-03-28T14:50:00Z.
1138
+ * * `size_bytes > 10000000000` - The backup's size is greater than 10GB
1139
+ * * `backup_schedules:daily`
1140
+ * - The backup is created from a schedule with "daily" in its name.
1141
+ * @param {number} request.pageSize
1142
+ * Number of backups to be returned in the response. If 0 or
1143
+ * less, defaults to the server's maximum allowed page size.
1144
+ * @param {string} request.pageToken
1145
+ * If non-empty, `page_token` should contain a
1146
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token}
1147
+ * from a previous
1148
+ * {@link protos.google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse}
1149
+ * to the same `parent` and with the same `filter`.
1150
+ * @param {object} [options]
1151
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1152
+ * @returns {Object}
1153
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1154
+ * When you iterate the returned iterable, each element will be an object representing
1155
+ * {@link protos.google.spanner.admin.database.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page,
1156
+ * so you can stop the iteration when you don't need more results.
1157
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1158
+ * for more details and examples.
1159
+ */
1160
+ listBackupsAsync(request, options) {
1161
+ var _a;
1162
+ request = request || {};
1163
+ options = options || {};
1164
+ options.otherArgs = options.otherArgs || {};
1165
+ options.otherArgs.headers = options.otherArgs.headers || {};
1166
+ options.otherArgs.headers['x-goog-request-params'] =
1167
+ this._gaxModule.routingHeader.fromParams({
1168
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1169
+ });
1170
+ const defaultCallSettings = this._defaults['listBackups'];
1171
+ const callSettings = defaultCallSettings.merge(options);
1172
+ this.initialize();
1173
+ return this.descriptors.page.listBackups.asyncIterate(this.innerApiCalls['listBackups'], request, callSettings);
1174
+ }
1175
+ listDatabaseOperations(request, optionsOrCallback, callback) {
1176
+ var _a;
1177
+ request = request || {};
1178
+ let options;
1179
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1180
+ callback = optionsOrCallback;
1181
+ options = {};
1182
+ }
1183
+ else {
1184
+ options = optionsOrCallback;
1185
+ }
1186
+ options = options || {};
1187
+ options.otherArgs = options.otherArgs || {};
1188
+ options.otherArgs.headers = options.otherArgs.headers || {};
1189
+ options.otherArgs.headers['x-goog-request-params'] =
1190
+ this._gaxModule.routingHeader.fromParams({
1191
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1192
+ });
1193
+ this.initialize();
1194
+ return this.innerApiCalls.listDatabaseOperations(request, options, callback);
1195
+ }
1196
+ /**
1197
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1198
+ * @param {Object} request
1199
+ * The request object that will be sent.
1200
+ * @param {string} request.parent
1201
+ * Required. The instance of the database operations.
1202
+ * Values are of the form `projects/<project>/instances/<instance>`.
1203
+ * @param {string} request.filter
1204
+ * An expression that filters the list of returned operations.
1205
+ *
1206
+ * A filter expression consists of a field name, a
1207
+ * comparison operator, and a value for filtering.
1208
+ * The value must be a string, a number, or a boolean. The comparison operator
1209
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1210
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1211
+ *
1212
+ * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1213
+ * are eligible for filtering:
1214
+ *
1215
+ * * `name` - The name of the long-running operation
1216
+ * * `done` - False if the operation is in progress, else true.
1217
+ * * `metadata.@type` - the type of metadata. For example, the type string
1218
+ * for
1219
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}
1220
+ * is
1221
+ * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1222
+ * * `metadata.<field_name>` - any field in metadata.value.
1223
+ * `metadata.@type` must be specified first, if filtering on metadata
1224
+ * fields.
1225
+ * * `error` - Error associated with the long-running operation.
1226
+ * * `response.@type` - the type of response.
1227
+ * * `response.<field_name>` - any field in response.value.
1228
+ *
1229
+ * You can combine multiple expressions by enclosing each expression in
1230
+ * parentheses. By default, expressions are combined with AND logic. However,
1231
+ * you can specify AND, OR, and NOT logic explicitly.
1232
+ *
1233
+ * Here are a few examples:
1234
+ *
1235
+ * * `done:true` - The operation is complete.
1236
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
1237
+ * `(metadata.source_type:BACKUP) AND` \
1238
+ * `(metadata.backup_info.backup:backup_howl) AND` \
1239
+ * `(metadata.name:restored_howl) AND` \
1240
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1241
+ * `(error:*)` - Return operations where:
1242
+ * * The operation's metadata type is
1243
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1244
+ * * The database is restored from a backup.
1245
+ * * The backup name contains "backup_howl".
1246
+ * * The restored database's name contains "restored_howl".
1247
+ * * The operation started before 2018-03-28T14:50:00Z.
1248
+ * * The operation resulted in an error.
1249
+ * @param {number} request.pageSize
1250
+ * Number of operations to be returned in the response. If 0 or
1251
+ * less, defaults to the server's maximum allowed page size.
1252
+ * @param {string} request.pageToken
1253
+ * If non-empty, `page_token` should contain a
1254
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
1255
+ * from a previous
1256
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse}
1257
+ * to the same `parent` and with the same `filter`.
1258
+ * @param {object} [options]
1259
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1260
+ * @returns {Stream}
1261
+ * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1262
+ * The client library will perform auto-pagination by default: it will call the API as many
1263
+ * times as needed. Note that it can affect your quota.
1264
+ * We recommend using `listDatabaseOperationsAsync()`
1265
+ * method described below for async iteration which you can stop as needed.
1266
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1267
+ * for more details and examples.
1268
+ */
1269
+ listDatabaseOperationsStream(request, options) {
1270
+ var _a;
1271
+ request = request || {};
1272
+ options = options || {};
1273
+ options.otherArgs = options.otherArgs || {};
1274
+ options.otherArgs.headers = options.otherArgs.headers || {};
1275
+ options.otherArgs.headers['x-goog-request-params'] =
1276
+ this._gaxModule.routingHeader.fromParams({
1277
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1278
+ });
1279
+ const defaultCallSettings = this._defaults['listDatabaseOperations'];
1280
+ const callSettings = defaultCallSettings.merge(options);
1281
+ this.initialize();
1282
+ return this.descriptors.page.listDatabaseOperations.createStream(this.innerApiCalls.listDatabaseOperations, request, callSettings);
1283
+ }
1284
+ /**
1285
+ * Equivalent to `listDatabaseOperations`, but returns an iterable object.
1286
+ *
1287
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1288
+ * @param {Object} request
1289
+ * The request object that will be sent.
1290
+ * @param {string} request.parent
1291
+ * Required. The instance of the database operations.
1292
+ * Values are of the form `projects/<project>/instances/<instance>`.
1293
+ * @param {string} request.filter
1294
+ * An expression that filters the list of returned operations.
1295
+ *
1296
+ * A filter expression consists of a field name, a
1297
+ * comparison operator, and a value for filtering.
1298
+ * The value must be a string, a number, or a boolean. The comparison operator
1299
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1300
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1301
+ *
1302
+ * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1303
+ * are eligible for filtering:
1304
+ *
1305
+ * * `name` - The name of the long-running operation
1306
+ * * `done` - False if the operation is in progress, else true.
1307
+ * * `metadata.@type` - the type of metadata. For example, the type string
1308
+ * for
1309
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}
1310
+ * is
1311
+ * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1312
+ * * `metadata.<field_name>` - any field in metadata.value.
1313
+ * `metadata.@type` must be specified first, if filtering on metadata
1314
+ * fields.
1315
+ * * `error` - Error associated with the long-running operation.
1316
+ * * `response.@type` - the type of response.
1317
+ * * `response.<field_name>` - any field in response.value.
1318
+ *
1319
+ * You can combine multiple expressions by enclosing each expression in
1320
+ * parentheses. By default, expressions are combined with AND logic. However,
1321
+ * you can specify AND, OR, and NOT logic explicitly.
1322
+ *
1323
+ * Here are a few examples:
1324
+ *
1325
+ * * `done:true` - The operation is complete.
1326
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
1327
+ * `(metadata.source_type:BACKUP) AND` \
1328
+ * `(metadata.backup_info.backup:backup_howl) AND` \
1329
+ * `(metadata.name:restored_howl) AND` \
1330
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1331
+ * `(error:*)` - Return operations where:
1332
+ * * The operation's metadata type is
1333
+ * {@link protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
1334
+ * * The database is restored from a backup.
1335
+ * * The backup name contains "backup_howl".
1336
+ * * The restored database's name contains "restored_howl".
1337
+ * * The operation started before 2018-03-28T14:50:00Z.
1338
+ * * The operation resulted in an error.
1339
+ * @param {number} request.pageSize
1340
+ * Number of operations to be returned in the response. If 0 or
1341
+ * less, defaults to the server's maximum allowed page size.
1342
+ * @param {string} request.pageToken
1343
+ * If non-empty, `page_token` should contain a
1344
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
1345
+ * from a previous
1346
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse}
1347
+ * to the same `parent` and with the same `filter`.
1348
+ * @param {object} [options]
1349
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1350
+ * @returns {Object}
1351
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1352
+ * When you iterate the returned iterable, each element will be an object representing
1353
+ * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1354
+ * so you can stop the iteration when you don't need more results.
1355
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1356
+ * for more details and examples.
1357
+ */
1358
+ listDatabaseOperationsAsync(request, options) {
1359
+ var _a;
1360
+ request = request || {};
1361
+ options = options || {};
1362
+ options.otherArgs = options.otherArgs || {};
1363
+ options.otherArgs.headers = options.otherArgs.headers || {};
1364
+ options.otherArgs.headers['x-goog-request-params'] =
1365
+ this._gaxModule.routingHeader.fromParams({
1366
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1367
+ });
1368
+ const defaultCallSettings = this._defaults['listDatabaseOperations'];
1369
+ const callSettings = defaultCallSettings.merge(options);
1370
+ this.initialize();
1371
+ return this.descriptors.page.listDatabaseOperations.asyncIterate(this.innerApiCalls['listDatabaseOperations'], request, callSettings);
1372
+ }
1373
+ listBackupOperations(request, optionsOrCallback, callback) {
1374
+ var _a;
1375
+ request = request || {};
1376
+ let options;
1377
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1378
+ callback = optionsOrCallback;
1379
+ options = {};
1380
+ }
1381
+ else {
1382
+ options = optionsOrCallback;
1383
+ }
1384
+ options = options || {};
1385
+ options.otherArgs = options.otherArgs || {};
1386
+ options.otherArgs.headers = options.otherArgs.headers || {};
1387
+ options.otherArgs.headers['x-goog-request-params'] =
1388
+ this._gaxModule.routingHeader.fromParams({
1389
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1390
+ });
1391
+ this.initialize();
1392
+ return this.innerApiCalls.listBackupOperations(request, options, callback);
1393
+ }
1394
+ /**
1395
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1396
+ * @param {Object} request
1397
+ * The request object that will be sent.
1398
+ * @param {string} request.parent
1399
+ * Required. The instance of the backup operations. Values are of
1400
+ * the form `projects/<project>/instances/<instance>`.
1401
+ * @param {string} request.filter
1402
+ * An expression that filters the list of returned backup operations.
1403
+ *
1404
+ * A filter expression consists of a field name, a
1405
+ * comparison operator, and a value for filtering.
1406
+ * The value must be a string, a number, or a boolean. The comparison operator
1407
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1408
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1409
+ *
1410
+ * The following fields in the {@link protos.google.longrunning.Operation|operation}
1411
+ * are eligible for filtering:
1412
+ *
1413
+ * * `name` - The name of the long-running operation
1414
+ * * `done` - False if the operation is in progress, else true.
1415
+ * * `metadata.@type` - the type of metadata. For example, the type string
1416
+ * for
1417
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1418
+ * is
1419
+ * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1420
+ * * `metadata.<field_name>` - any field in metadata.value.
1421
+ * `metadata.@type` must be specified first if filtering on metadata
1422
+ * fields.
1423
+ * * `error` - Error associated with the long-running operation.
1424
+ * * `response.@type` - the type of response.
1425
+ * * `response.<field_name>` - any field in response.value.
1426
+ *
1427
+ * You can combine multiple expressions by enclosing each expression in
1428
+ * parentheses. By default, expressions are combined with AND logic, but
1429
+ * you can specify AND, OR, and NOT logic explicitly.
1430
+ *
1431
+ * Here are a few examples:
1432
+ *
1433
+ * * `done:true` - The operation is complete.
1434
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1435
+ * `metadata.database:prod` - Returns operations where:
1436
+ * * The operation's metadata type is
1437
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1438
+ * * The source database name of backup contains the string "prod".
1439
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1440
+ * `(metadata.name:howl) AND` \
1441
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1442
+ * `(error:*)` - Returns operations where:
1443
+ * * The operation's metadata type is
1444
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1445
+ * * The backup name contains the string "howl".
1446
+ * * The operation started before 2018-03-28T14:50:00Z.
1447
+ * * The operation resulted in an error.
1448
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
1449
+ * `(metadata.source_backup:test) AND` \
1450
+ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
1451
+ * `(error:*)` - Returns operations where:
1452
+ * * The operation's metadata type is
1453
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1454
+ * * The source backup name contains the string "test".
1455
+ * * The operation started before 2022-01-18T14:50:00Z.
1456
+ * * The operation resulted in an error.
1457
+ * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1458
+ * `(metadata.database:test_db)) OR` \
1459
+ * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
1460
+ * AND` \
1461
+ * `(metadata.source_backup:test_bkp)) AND` \
1462
+ * `(error:*)` - Returns operations where:
1463
+ * * The operation's metadata matches either of criteria:
1464
+ * * The operation's metadata type is
1465
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1466
+ * AND the source database name of the backup contains the string
1467
+ * "test_db"
1468
+ * * The operation's metadata type is
1469
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}
1470
+ * AND the source backup name contains the string "test_bkp"
1471
+ * * The operation resulted in an error.
1472
+ * @param {number} request.pageSize
1473
+ * Number of operations to be returned in the response. If 0 or
1474
+ * less, defaults to the server's maximum allowed page size.
1475
+ * @param {string} request.pageToken
1476
+ * If non-empty, `page_token` should contain a
1477
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
1478
+ * from a previous
1479
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse}
1480
+ * to the same `parent` and with the same `filter`.
1481
+ * @param {object} [options]
1482
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1483
+ * @returns {Stream}
1484
+ * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1485
+ * The client library will perform auto-pagination by default: it will call the API as many
1486
+ * times as needed. Note that it can affect your quota.
1487
+ * We recommend using `listBackupOperationsAsync()`
1488
+ * method described below for async iteration which you can stop as needed.
1489
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1490
+ * for more details and examples.
1491
+ */
1492
+ listBackupOperationsStream(request, options) {
1493
+ var _a;
1494
+ request = request || {};
1495
+ options = options || {};
1496
+ options.otherArgs = options.otherArgs || {};
1497
+ options.otherArgs.headers = options.otherArgs.headers || {};
1498
+ options.otherArgs.headers['x-goog-request-params'] =
1499
+ this._gaxModule.routingHeader.fromParams({
1500
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1501
+ });
1502
+ const defaultCallSettings = this._defaults['listBackupOperations'];
1503
+ const callSettings = defaultCallSettings.merge(options);
1504
+ this.initialize();
1505
+ return this.descriptors.page.listBackupOperations.createStream(this.innerApiCalls.listBackupOperations, request, callSettings);
1506
+ }
1507
+ /**
1508
+ * Equivalent to `listBackupOperations`, but returns an iterable object.
1509
+ *
1510
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1511
+ * @param {Object} request
1512
+ * The request object that will be sent.
1513
+ * @param {string} request.parent
1514
+ * Required. The instance of the backup operations. Values are of
1515
+ * the form `projects/<project>/instances/<instance>`.
1516
+ * @param {string} request.filter
1517
+ * An expression that filters the list of returned backup operations.
1518
+ *
1519
+ * A filter expression consists of a field name, a
1520
+ * comparison operator, and a value for filtering.
1521
+ * The value must be a string, a number, or a boolean. The comparison operator
1522
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1523
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1524
+ *
1525
+ * The following fields in the {@link protos.google.longrunning.Operation|operation}
1526
+ * are eligible for filtering:
1527
+ *
1528
+ * * `name` - The name of the long-running operation
1529
+ * * `done` - False if the operation is in progress, else true.
1530
+ * * `metadata.@type` - the type of metadata. For example, the type string
1531
+ * for
1532
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1533
+ * is
1534
+ * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1535
+ * * `metadata.<field_name>` - any field in metadata.value.
1536
+ * `metadata.@type` must be specified first if filtering on metadata
1537
+ * fields.
1538
+ * * `error` - Error associated with the long-running operation.
1539
+ * * `response.@type` - the type of response.
1540
+ * * `response.<field_name>` - any field in response.value.
1541
+ *
1542
+ * You can combine multiple expressions by enclosing each expression in
1543
+ * parentheses. By default, expressions are combined with AND logic, but
1544
+ * you can specify AND, OR, and NOT logic explicitly.
1545
+ *
1546
+ * Here are a few examples:
1547
+ *
1548
+ * * `done:true` - The operation is complete.
1549
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1550
+ * `metadata.database:prod` - Returns operations where:
1551
+ * * The operation's metadata type is
1552
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1553
+ * * The source database name of backup contains the string "prod".
1554
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1555
+ * `(metadata.name:howl) AND` \
1556
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1557
+ * `(error:*)` - Returns operations where:
1558
+ * * The operation's metadata type is
1559
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1560
+ * * The backup name contains the string "howl".
1561
+ * * The operation started before 2018-03-28T14:50:00Z.
1562
+ * * The operation resulted in an error.
1563
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
1564
+ * `(metadata.source_backup:test) AND` \
1565
+ * `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
1566
+ * `(error:*)` - Returns operations where:
1567
+ * * The operation's metadata type is
1568
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
1569
+ * * The source backup name contains the string "test".
1570
+ * * The operation started before 2022-01-18T14:50:00Z.
1571
+ * * The operation resulted in an error.
1572
+ * * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1573
+ * `(metadata.database:test_db)) OR` \
1574
+ * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
1575
+ * AND` \
1576
+ * `(metadata.source_backup:test_bkp)) AND` \
1577
+ * `(error:*)` - Returns operations where:
1578
+ * * The operation's metadata matches either of criteria:
1579
+ * * The operation's metadata type is
1580
+ * {@link protos.google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}
1581
+ * AND the source database name of the backup contains the string
1582
+ * "test_db"
1583
+ * * The operation's metadata type is
1584
+ * {@link protos.google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}
1585
+ * AND the source backup name contains the string "test_bkp"
1586
+ * * The operation resulted in an error.
1587
+ * @param {number} request.pageSize
1588
+ * Number of operations to be returned in the response. If 0 or
1589
+ * less, defaults to the server's maximum allowed page size.
1590
+ * @param {string} request.pageToken
1591
+ * If non-empty, `page_token` should contain a
1592
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
1593
+ * from a previous
1594
+ * {@link protos.google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse}
1595
+ * to the same `parent` and with the same `filter`.
1596
+ * @param {object} [options]
1597
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1598
+ * @returns {Object}
1599
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1600
+ * When you iterate the returned iterable, each element will be an object representing
1601
+ * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1602
+ * so you can stop the iteration when you don't need more results.
1603
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1604
+ * for more details and examples.
1605
+ */
1606
+ listBackupOperationsAsync(request, options) {
1607
+ var _a;
1608
+ request = request || {};
1609
+ options = options || {};
1610
+ options.otherArgs = options.otherArgs || {};
1611
+ options.otherArgs.headers = options.otherArgs.headers || {};
1612
+ options.otherArgs.headers['x-goog-request-params'] =
1613
+ this._gaxModule.routingHeader.fromParams({
1614
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1615
+ });
1616
+ const defaultCallSettings = this._defaults['listBackupOperations'];
1617
+ const callSettings = defaultCallSettings.merge(options);
1618
+ this.initialize();
1619
+ return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
1620
+ }
1621
+ listDatabaseRoles(request, optionsOrCallback, callback) {
1622
+ var _a;
1623
+ request = request || {};
1624
+ let options;
1625
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1626
+ callback = optionsOrCallback;
1627
+ options = {};
1628
+ }
1629
+ else {
1630
+ options = optionsOrCallback;
1631
+ }
1632
+ options = options || {};
1633
+ options.otherArgs = options.otherArgs || {};
1634
+ options.otherArgs.headers = options.otherArgs.headers || {};
1635
+ options.otherArgs.headers['x-goog-request-params'] =
1636
+ this._gaxModule.routingHeader.fromParams({
1637
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1638
+ });
1639
+ this.initialize();
1640
+ return this.innerApiCalls.listDatabaseRoles(request, options, callback);
1641
+ }
1642
+ /**
1643
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1644
+ * @param {Object} request
1645
+ * The request object that will be sent.
1646
+ * @param {string} request.parent
1647
+ * Required. The database whose roles should be listed.
1648
+ * Values are of the form
1649
+ * `projects/<project>/instances/<instance>/databases/<database>`.
1650
+ * @param {number} request.pageSize
1651
+ * Number of database roles to be returned in the response. If 0 or less,
1652
+ * defaults to the server's maximum allowed page size.
1653
+ * @param {string} request.pageToken
1654
+ * If non-empty, `page_token` should contain a
1655
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token}
1656
+ * from a previous
1657
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1658
+ * @param {object} [options]
1659
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1660
+ * @returns {Stream}
1661
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole} on 'data' event.
1662
+ * The client library will perform auto-pagination by default: it will call the API as many
1663
+ * times as needed. Note that it can affect your quota.
1664
+ * We recommend using `listDatabaseRolesAsync()`
1665
+ * method described below for async iteration which you can stop as needed.
1666
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1667
+ * for more details and examples.
1668
+ */
1669
+ listDatabaseRolesStream(request, options) {
1670
+ var _a;
1671
+ request = request || {};
1672
+ options = options || {};
1673
+ options.otherArgs = options.otherArgs || {};
1674
+ options.otherArgs.headers = options.otherArgs.headers || {};
1675
+ options.otherArgs.headers['x-goog-request-params'] =
1676
+ this._gaxModule.routingHeader.fromParams({
1677
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1678
+ });
1679
+ const defaultCallSettings = this._defaults['listDatabaseRoles'];
1680
+ const callSettings = defaultCallSettings.merge(options);
1681
+ this.initialize();
1682
+ return this.descriptors.page.listDatabaseRoles.createStream(this.innerApiCalls.listDatabaseRoles, request, callSettings);
1683
+ }
1684
+ /**
1685
+ * Equivalent to `listDatabaseRoles`, but returns an iterable object.
1686
+ *
1687
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1688
+ * @param {Object} request
1689
+ * The request object that will be sent.
1690
+ * @param {string} request.parent
1691
+ * Required. The database whose roles should be listed.
1692
+ * Values are of the form
1693
+ * `projects/<project>/instances/<instance>/databases/<database>`.
1694
+ * @param {number} request.pageSize
1695
+ * Number of database roles to be returned in the response. If 0 or less,
1696
+ * defaults to the server's maximum allowed page size.
1697
+ * @param {string} request.pageToken
1698
+ * If non-empty, `page_token` should contain a
1699
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token}
1700
+ * from a previous
1701
+ * {@link protos.google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
1702
+ * @param {object} [options]
1703
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1704
+ * @returns {Object}
1705
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1706
+ * When you iterate the returned iterable, each element will be an object representing
1707
+ * {@link protos.google.spanner.admin.database.v1.DatabaseRole|DatabaseRole}. The API will be called under the hood as needed, once per the page,
1708
+ * so you can stop the iteration when you don't need more results.
1709
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1710
+ * for more details and examples.
1711
+ */
1712
+ listDatabaseRolesAsync(request, options) {
1713
+ var _a;
1714
+ request = request || {};
1715
+ options = options || {};
1716
+ options.otherArgs = options.otherArgs || {};
1717
+ options.otherArgs.headers = options.otherArgs.headers || {};
1718
+ options.otherArgs.headers['x-goog-request-params'] =
1719
+ this._gaxModule.routingHeader.fromParams({
1720
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1721
+ });
1722
+ const defaultCallSettings = this._defaults['listDatabaseRoles'];
1723
+ const callSettings = defaultCallSettings.merge(options);
1724
+ this.initialize();
1725
+ return this.descriptors.page.listDatabaseRoles.asyncIterate(this.innerApiCalls['listDatabaseRoles'], request, callSettings);
1726
+ }
1727
+ listBackupSchedules(request, optionsOrCallback, callback) {
1728
+ var _a;
1729
+ request = request || {};
1730
+ let options;
1731
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1732
+ callback = optionsOrCallback;
1733
+ options = {};
1734
+ }
1735
+ else {
1736
+ options = optionsOrCallback;
1737
+ }
1738
+ options = options || {};
1739
+ options.otherArgs = options.otherArgs || {};
1740
+ options.otherArgs.headers = options.otherArgs.headers || {};
1741
+ options.otherArgs.headers['x-goog-request-params'] =
1742
+ this._gaxModule.routingHeader.fromParams({
1743
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1744
+ });
1745
+ this.initialize();
1746
+ return this.innerApiCalls.listBackupSchedules(request, options, callback);
1747
+ }
1748
+ /**
1749
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1750
+ * @param {Object} request
1751
+ * The request object that will be sent.
1752
+ * @param {string} request.parent
1753
+ * Required. Database is the parent resource whose backup schedules should be
1754
+ * listed. Values are of the form
1755
+ * projects/<project>/instances/<instance>/databases/<database>
1756
+ * @param {number} [request.pageSize]
1757
+ * Optional. Number of backup schedules to be returned in the response. If 0
1758
+ * or less, defaults to the server's maximum allowed page size.
1759
+ * @param {string} [request.pageToken]
1760
+ * Optional. If non-empty, `page_token` should contain a
1761
+ * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token}
1762
+ * from a previous
1763
+ * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse}
1764
+ * to the same `parent`.
1765
+ * @param {object} [options]
1766
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1767
+ * @returns {Stream}
1768
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule} on 'data' event.
1769
+ * The client library will perform auto-pagination by default: it will call the API as many
1770
+ * times as needed. Note that it can affect your quota.
1771
+ * We recommend using `listBackupSchedulesAsync()`
1772
+ * method described below for async iteration which you can stop as needed.
1773
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1774
+ * for more details and examples.
1775
+ */
1776
+ listBackupSchedulesStream(request, options) {
1777
+ var _a;
1778
+ request = request || {};
1779
+ options = options || {};
1780
+ options.otherArgs = options.otherArgs || {};
1781
+ options.otherArgs.headers = options.otherArgs.headers || {};
1782
+ options.otherArgs.headers['x-goog-request-params'] =
1783
+ this._gaxModule.routingHeader.fromParams({
1784
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1785
+ });
1786
+ const defaultCallSettings = this._defaults['listBackupSchedules'];
1787
+ const callSettings = defaultCallSettings.merge(options);
1788
+ this.initialize();
1789
+ return this.descriptors.page.listBackupSchedules.createStream(this.innerApiCalls.listBackupSchedules, request, callSettings);
1790
+ }
1791
+ /**
1792
+ * Equivalent to `listBackupSchedules`, but returns an iterable object.
1793
+ *
1794
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1795
+ * @param {Object} request
1796
+ * The request object that will be sent.
1797
+ * @param {string} request.parent
1798
+ * Required. Database is the parent resource whose backup schedules should be
1799
+ * listed. Values are of the form
1800
+ * projects/<project>/instances/<instance>/databases/<database>
1801
+ * @param {number} [request.pageSize]
1802
+ * Optional. Number of backup schedules to be returned in the response. If 0
1803
+ * or less, defaults to the server's maximum allowed page size.
1804
+ * @param {string} [request.pageToken]
1805
+ * Optional. If non-empty, `page_token` should contain a
1806
+ * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token}
1807
+ * from a previous
1808
+ * {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse}
1809
+ * to the same `parent`.
1810
+ * @param {object} [options]
1811
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1812
+ * @returns {Object}
1813
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1814
+ * When you iterate the returned iterable, each element will be an object representing
1815
+ * {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. The API will be called under the hood as needed, once per the page,
1816
+ * so you can stop the iteration when you don't need more results.
1817
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1818
+ * for more details and examples.
1819
+ */
1820
+ listBackupSchedulesAsync(request, options) {
1821
+ var _a;
1822
+ request = request || {};
1823
+ options = options || {};
1824
+ options.otherArgs = options.otherArgs || {};
1825
+ options.otherArgs.headers = options.otherArgs.headers || {};
1826
+ options.otherArgs.headers['x-goog-request-params'] =
1827
+ this._gaxModule.routingHeader.fromParams({
1828
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1829
+ });
1830
+ const defaultCallSettings = this._defaults['listBackupSchedules'];
1831
+ const callSettings = defaultCallSettings.merge(options);
1832
+ this.initialize();
1833
+ return this.descriptors.page.listBackupSchedules.asyncIterate(this.innerApiCalls['listBackupSchedules'], request, callSettings);
1834
+ }
1835
+ /**
1836
+ * Gets the latest state of a long-running operation. Clients can use this
1837
+ * method to poll the operation result at intervals as recommended by the API
1838
+ * service.
1839
+ *
1840
+ * @param {Object} request - The request object that will be sent.
1841
+ * @param {string} request.name - The name of the operation resource.
1842
+ * @param {Object=} options
1843
+ * Optional parameters. You can override the default settings for this call,
1844
+ * e.g, timeout, retries, paginations, etc. See {@link
1845
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1846
+ * for the details.
1847
+ * @param {function(?Error, ?Object)=} callback
1848
+ * The function which will be called with the result of the API call.
1849
+ *
1850
+ * The second parameter to the callback is an object representing
1851
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1852
+ * @return {Promise} - The promise which resolves to an array.
1853
+ * The first element of the array is an object representing
1854
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
1855
+ * The promise has a method named "cancel" which cancels the ongoing API call.
1856
+ *
1857
+ * @example
1858
+ * ```
1859
+ * const client = longrunning.operationsClient();
1860
+ * const name = '';
1861
+ * const [response] = await client.getOperation({name});
1862
+ * // doThingsWith(response)
1863
+ * ```
1864
+ */
1865
+ getOperation(request, options, callback) {
1866
+ return this.operationsClient.getOperation(request, options, callback);
1867
+ }
1868
+ /**
1869
+ * Lists operations that match the specified filter in the request. If the
1870
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
1871
+ *
1872
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
1873
+ *
1874
+ * @param {Object} request - The request object that will be sent.
1875
+ * @param {string} request.name - The name of the operation collection.
1876
+ * @param {string} request.filter - The standard list filter.
1877
+ * @param {number=} request.pageSize -
1878
+ * The maximum number of resources contained in the underlying API
1879
+ * response. If page streaming is performed per-resource, this
1880
+ * parameter does not affect the return value. If page streaming is
1881
+ * performed per-page, this determines the maximum number of
1882
+ * resources in a page.
1883
+ * @param {Object=} options
1884
+ * Optional parameters. You can override the default settings for this call,
1885
+ * e.g, timeout, retries, paginations, etc. See {@link
1886
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
1887
+ * details.
1888
+ * @returns {Object}
1889
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
1890
+ *
1891
+ * @example
1892
+ * ```
1893
+ * const client = longrunning.operationsClient();
1894
+ * for await (const response of client.listOperationsAsync(request));
1895
+ * // doThingsWith(response)
1896
+ * ```
1897
+ */
1898
+ listOperationsAsync(request, options) {
1899
+ return this.operationsClient.listOperationsAsync(request, options);
1900
+ }
1901
+ /**
1902
+ * Starts asynchronous cancellation on a long-running operation. The server
1903
+ * makes a best effort to cancel the operation, but success is not
1904
+ * guaranteed. If the server doesn't support this method, it returns
1905
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
1906
+ * {@link Operations.GetOperation} or
1907
+ * other methods to check whether the cancellation succeeded or whether the
1908
+ * operation completed despite cancellation. On successful cancellation,
1909
+ * the operation is not deleted; instead, it becomes an operation with
1910
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
1911
+ * 1, corresponding to `Code.CANCELLED`.
1912
+ *
1913
+ * @param {Object} request - The request object that will be sent.
1914
+ * @param {string} request.name - The name of the operation resource to be cancelled.
1915
+ * @param {Object=} options
1916
+ * Optional parameters. You can override the default settings for this call,
1917
+ * e.g, timeout, retries, paginations, etc. See {@link
1918
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
1919
+ * details.
1920
+ * @param {function(?Error)=} callback
1921
+ * The function which will be called with the result of the API call.
1922
+ * @return {Promise} - The promise which resolves when API call finishes.
1923
+ * The promise has a method named "cancel" which cancels the ongoing API
1924
+ * call.
1925
+ *
1926
+ * @example
1927
+ * ```
1928
+ * const client = longrunning.operationsClient();
1929
+ * await client.cancelOperation({name: ''});
1930
+ * ```
1931
+ */
1932
+ cancelOperation(request, options, callback) {
1933
+ return this.operationsClient.cancelOperation(request, options, callback);
1934
+ }
1935
+ /**
1936
+ * Deletes a long-running operation. This method indicates that the client is
1937
+ * no longer interested in the operation result. It does not cancel the
1938
+ * operation. If the server doesn't support this method, it returns
1939
+ * `google.rpc.Code.UNIMPLEMENTED`.
1940
+ *
1941
+ * @param {Object} request - The request object that will be sent.
1942
+ * @param {string} request.name - The name of the operation resource to be deleted.
1943
+ * @param {Object=} options
1944
+ * Optional parameters. You can override the default settings for this call,
1945
+ * e.g, timeout, retries, paginations, etc. See {@link
1946
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
1947
+ * for the details.
1948
+ * @param {function(?Error)=} callback
1949
+ * The function which will be called with the result of the API call.
1950
+ * @return {Promise} - The promise which resolves when API call finishes.
1951
+ * The promise has a method named "cancel" which cancels the ongoing API
1952
+ * call.
1953
+ *
1954
+ * @example
1955
+ * ```
1956
+ * const client = longrunning.operationsClient();
1957
+ * await client.deleteOperation({name: ''});
1958
+ * ```
1959
+ */
1960
+ deleteOperation(request, options, callback) {
1961
+ return this.operationsClient.deleteOperation(request, options, callback);
1962
+ }
1963
+ // --------------------
1964
+ // -- Path templates --
1965
+ // --------------------
1966
+ /**
1967
+ * Return a fully-qualified backup resource name string.
1968
+ *
1969
+ * @param {string} project
1970
+ * @param {string} instance
1971
+ * @param {string} backup
1972
+ * @returns {string} Resource name string.
1973
+ */
1974
+ backupPath(project, instance, backup) {
1975
+ return this.pathTemplates.backupPathTemplate.render({
1976
+ project: project,
1977
+ instance: instance,
1978
+ backup: backup,
1979
+ });
1980
+ }
1981
+ /**
1982
+ * Parse the project from Backup resource.
1983
+ *
1984
+ * @param {string} backupName
1985
+ * A fully-qualified path representing Backup resource.
1986
+ * @returns {string} A string representing the project.
1987
+ */
1988
+ matchProjectFromBackupName(backupName) {
1989
+ return this.pathTemplates.backupPathTemplate.match(backupName).project;
1990
+ }
1991
+ /**
1992
+ * Parse the instance from Backup resource.
1993
+ *
1994
+ * @param {string} backupName
1995
+ * A fully-qualified path representing Backup resource.
1996
+ * @returns {string} A string representing the instance.
1997
+ */
1998
+ matchInstanceFromBackupName(backupName) {
1999
+ return this.pathTemplates.backupPathTemplate.match(backupName).instance;
2000
+ }
2001
+ /**
2002
+ * Parse the backup from Backup resource.
2003
+ *
2004
+ * @param {string} backupName
2005
+ * A fully-qualified path representing Backup resource.
2006
+ * @returns {string} A string representing the backup.
2007
+ */
2008
+ matchBackupFromBackupName(backupName) {
2009
+ return this.pathTemplates.backupPathTemplate.match(backupName).backup;
2010
+ }
2011
+ /**
2012
+ * Return a fully-qualified backupSchedule resource name string.
2013
+ *
2014
+ * @param {string} project
2015
+ * @param {string} instance
2016
+ * @param {string} database
2017
+ * @param {string} schedule
2018
+ * @returns {string} Resource name string.
2019
+ */
2020
+ backupSchedulePath(project, instance, database, schedule) {
2021
+ return this.pathTemplates.backupSchedulePathTemplate.render({
2022
+ project: project,
2023
+ instance: instance,
2024
+ database: database,
2025
+ schedule: schedule,
2026
+ });
2027
+ }
2028
+ /**
2029
+ * Parse the project from BackupSchedule resource.
2030
+ *
2031
+ * @param {string} backupScheduleName
2032
+ * A fully-qualified path representing BackupSchedule resource.
2033
+ * @returns {string} A string representing the project.
2034
+ */
2035
+ matchProjectFromBackupScheduleName(backupScheduleName) {
2036
+ return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project;
2037
+ }
2038
+ /**
2039
+ * Parse the instance from BackupSchedule resource.
2040
+ *
2041
+ * @param {string} backupScheduleName
2042
+ * A fully-qualified path representing BackupSchedule resource.
2043
+ * @returns {string} A string representing the instance.
2044
+ */
2045
+ matchInstanceFromBackupScheduleName(backupScheduleName) {
2046
+ return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance;
2047
+ }
2048
+ /**
2049
+ * Parse the database from BackupSchedule resource.
2050
+ *
2051
+ * @param {string} backupScheduleName
2052
+ * A fully-qualified path representing BackupSchedule resource.
2053
+ * @returns {string} A string representing the database.
2054
+ */
2055
+ matchDatabaseFromBackupScheduleName(backupScheduleName) {
2056
+ return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database;
2057
+ }
2058
+ /**
2059
+ * Parse the schedule from BackupSchedule resource.
2060
+ *
2061
+ * @param {string} backupScheduleName
2062
+ * A fully-qualified path representing BackupSchedule resource.
2063
+ * @returns {string} A string representing the schedule.
2064
+ */
2065
+ matchScheduleFromBackupScheduleName(backupScheduleName) {
2066
+ return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule;
2067
+ }
2068
+ /**
2069
+ * Return a fully-qualified cryptoKey resource name string.
2070
+ *
2071
+ * @param {string} project
2072
+ * @param {string} location
2073
+ * @param {string} key_ring
2074
+ * @param {string} crypto_key
2075
+ * @returns {string} Resource name string.
2076
+ */
2077
+ cryptoKeyPath(project, location, keyRing, cryptoKey) {
2078
+ return this.pathTemplates.cryptoKeyPathTemplate.render({
2079
+ project: project,
2080
+ location: location,
2081
+ key_ring: keyRing,
2082
+ crypto_key: cryptoKey,
2083
+ });
2084
+ }
2085
+ /**
2086
+ * Parse the project from CryptoKey resource.
2087
+ *
2088
+ * @param {string} cryptoKeyName
2089
+ * A fully-qualified path representing CryptoKey resource.
2090
+ * @returns {string} A string representing the project.
2091
+ */
2092
+ matchProjectFromCryptoKeyName(cryptoKeyName) {
2093
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
2094
+ .project;
2095
+ }
2096
+ /**
2097
+ * Parse the location from CryptoKey resource.
2098
+ *
2099
+ * @param {string} cryptoKeyName
2100
+ * A fully-qualified path representing CryptoKey resource.
2101
+ * @returns {string} A string representing the location.
2102
+ */
2103
+ matchLocationFromCryptoKeyName(cryptoKeyName) {
2104
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
2105
+ .location;
2106
+ }
2107
+ /**
2108
+ * Parse the key_ring from CryptoKey resource.
2109
+ *
2110
+ * @param {string} cryptoKeyName
2111
+ * A fully-qualified path representing CryptoKey resource.
2112
+ * @returns {string} A string representing the key_ring.
2113
+ */
2114
+ matchKeyRingFromCryptoKeyName(cryptoKeyName) {
2115
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
2116
+ .key_ring;
2117
+ }
2118
+ /**
2119
+ * Parse the crypto_key from CryptoKey resource.
2120
+ *
2121
+ * @param {string} cryptoKeyName
2122
+ * A fully-qualified path representing CryptoKey resource.
2123
+ * @returns {string} A string representing the crypto_key.
2124
+ */
2125
+ matchCryptoKeyFromCryptoKeyName(cryptoKeyName) {
2126
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
2127
+ .crypto_key;
2128
+ }
2129
+ /**
2130
+ * Return a fully-qualified database resource name string.
2131
+ *
2132
+ * @param {string} project
2133
+ * @param {string} instance
2134
+ * @param {string} database
2135
+ * @returns {string} Resource name string.
2136
+ */
2137
+ databasePath(project, instance, database) {
2138
+ return this.pathTemplates.databasePathTemplate.render({
2139
+ project: project,
2140
+ instance: instance,
2141
+ database: database,
2142
+ });
2143
+ }
2144
+ /**
2145
+ * Parse the project from Database resource.
2146
+ *
2147
+ * @param {string} databaseName
2148
+ * A fully-qualified path representing Database resource.
2149
+ * @returns {string} A string representing the project.
2150
+ */
2151
+ matchProjectFromDatabaseName(databaseName) {
2152
+ return this.pathTemplates.databasePathTemplate.match(databaseName).project;
2153
+ }
2154
+ /**
2155
+ * Parse the instance from Database resource.
2156
+ *
2157
+ * @param {string} databaseName
2158
+ * A fully-qualified path representing Database resource.
2159
+ * @returns {string} A string representing the instance.
2160
+ */
2161
+ matchInstanceFromDatabaseName(databaseName) {
2162
+ return this.pathTemplates.databasePathTemplate.match(databaseName).instance;
2163
+ }
2164
+ /**
2165
+ * Parse the database from Database resource.
2166
+ *
2167
+ * @param {string} databaseName
2168
+ * A fully-qualified path representing Database resource.
2169
+ * @returns {string} A string representing the database.
2170
+ */
2171
+ matchDatabaseFromDatabaseName(databaseName) {
2172
+ return this.pathTemplates.databasePathTemplate.match(databaseName).database;
2173
+ }
2174
+ /**
2175
+ * Return a fully-qualified databaseRole resource name string.
2176
+ *
2177
+ * @param {string} project
2178
+ * @param {string} instance
2179
+ * @param {string} database
2180
+ * @param {string} role
2181
+ * @returns {string} Resource name string.
2182
+ */
2183
+ databaseRolePath(project, instance, database, role) {
2184
+ return this.pathTemplates.databaseRolePathTemplate.render({
2185
+ project: project,
2186
+ instance: instance,
2187
+ database: database,
2188
+ role: role,
2189
+ });
2190
+ }
2191
+ /**
2192
+ * Parse the project from DatabaseRole resource.
2193
+ *
2194
+ * @param {string} databaseRoleName
2195
+ * A fully-qualified path representing DatabaseRole resource.
2196
+ * @returns {string} A string representing the project.
2197
+ */
2198
+ matchProjectFromDatabaseRoleName(databaseRoleName) {
2199
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
2200
+ .project;
2201
+ }
2202
+ /**
2203
+ * Parse the instance from DatabaseRole resource.
2204
+ *
2205
+ * @param {string} databaseRoleName
2206
+ * A fully-qualified path representing DatabaseRole resource.
2207
+ * @returns {string} A string representing the instance.
2208
+ */
2209
+ matchInstanceFromDatabaseRoleName(databaseRoleName) {
2210
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
2211
+ .instance;
2212
+ }
2213
+ /**
2214
+ * Parse the database from DatabaseRole resource.
2215
+ *
2216
+ * @param {string} databaseRoleName
2217
+ * A fully-qualified path representing DatabaseRole resource.
2218
+ * @returns {string} A string representing the database.
2219
+ */
2220
+ matchDatabaseFromDatabaseRoleName(databaseRoleName) {
2221
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
2222
+ .database;
2223
+ }
2224
+ /**
2225
+ * Parse the role from DatabaseRole resource.
2226
+ *
2227
+ * @param {string} databaseRoleName
2228
+ * A fully-qualified path representing DatabaseRole resource.
2229
+ * @returns {string} A string representing the role.
2230
+ */
2231
+ matchRoleFromDatabaseRoleName(databaseRoleName) {
2232
+ return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
2233
+ .role;
2234
+ }
2235
+ /**
2236
+ * Return a fully-qualified instance resource name string.
2237
+ *
2238
+ * @param {string} project
2239
+ * @param {string} instance
2240
+ * @returns {string} Resource name string.
2241
+ */
2242
+ instancePath(project, instance) {
2243
+ return this.pathTemplates.instancePathTemplate.render({
2244
+ project: project,
2245
+ instance: instance,
2246
+ });
2247
+ }
2248
+ /**
2249
+ * Parse the project from Instance resource.
2250
+ *
2251
+ * @param {string} instanceName
2252
+ * A fully-qualified path representing Instance resource.
2253
+ * @returns {string} A string representing the project.
2254
+ */
2255
+ matchProjectFromInstanceName(instanceName) {
2256
+ return this.pathTemplates.instancePathTemplate.match(instanceName).project;
2257
+ }
2258
+ /**
2259
+ * Parse the instance from Instance resource.
2260
+ *
2261
+ * @param {string} instanceName
2262
+ * A fully-qualified path representing Instance resource.
2263
+ * @returns {string} A string representing the instance.
2264
+ */
2265
+ matchInstanceFromInstanceName(instanceName) {
2266
+ return this.pathTemplates.instancePathTemplate.match(instanceName).instance;
2267
+ }
2268
+ /**
2269
+ * Terminate the gRPC channel and close the client.
2270
+ *
2271
+ * The client will no longer be usable and all future behavior is undefined.
2272
+ * @returns {Promise} A promise that resolves when the client is closed.
2273
+ */
2274
+ close() {
2275
+ if (this.databaseAdminStub && !this._terminated) {
2276
+ return this.databaseAdminStub.then(stub => {
2277
+ this._terminated = true;
2278
+ stub.close();
2279
+ this.operationsClient.close();
2280
+ });
2281
+ }
2282
+ return Promise.resolve();
2283
+ }
2284
+ }
2285
+ exports.DatabaseAdminClient = DatabaseAdminClient;
2286
+ //# sourceMappingURL=database_admin_client.js.map