@google-cloud/spanner 8.9.0 → 8.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/build/protos/status.json +243 -0
  2. package/build/src/backup.d.ts +2 -1
  3. package/build/src/batch-transaction.d.ts +2 -1
  4. package/build/src/codec.d.ts +2 -1
  5. package/build/src/codec.js +21 -20
  6. package/build/src/common.d.ts +3 -2
  7. package/build/src/database.d.ts +5 -2
  8. package/build/src/index.d.ts +3 -2
  9. package/build/src/index.js +7 -16
  10. package/build/src/instance-config.d.ts +2 -1
  11. package/build/src/instance.d.ts +4 -3
  12. package/build/src/instance.js +3 -2
  13. package/build/src/partial-result-stream.d.ts +2 -1
  14. package/build/src/partial-result-stream.js +5 -4
  15. package/build/src/protos.d.ts +21 -0
  16. package/build/src/protos.js +52 -0
  17. package/build/src/session.d.ts +2 -1
  18. package/build/src/spanner_grpc_config.json +1 -1
  19. package/build/src/table.d.ts +3 -2
  20. package/build/src/table.js +4 -3
  21. package/build/src/transaction-runner.d.ts +2 -1
  22. package/build/src/transaction-runner.js +6 -8
  23. package/build/src/transaction.d.ts +3 -2
  24. package/build/src/transaction.js +6 -5
  25. package/build/src/v1/index.d.ts +1 -4
  26. package/build/src/v1/index.js +5 -8
  27. package/package.json +8 -6
  28. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -773
  29. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  30. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  31. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1314
  32. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -64
  33. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -2184
  34. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1604
  35. package/build/protos/google/spanner/v1/change_stream.proto +0 -451
  36. package/build/protos/google/spanner/v1/commit_response.proto +0 -80
  37. package/build/protos/google/spanner/v1/keys.proto +0 -163
  38. package/build/protos/google/spanner/v1/location.proto +0 -388
  39. package/build/protos/google/spanner/v1/mutation.proto +0 -156
  40. package/build/protos/google/spanner/v1/query_plan.proto +0 -156
  41. package/build/protos/google/spanner/v1/result_set.proto +0 -260
  42. package/build/protos/google/spanner/v1/spanner.proto +0 -1472
  43. package/build/protos/google/spanner/v1/transaction.proto +0 -329
  44. package/build/protos/google/spanner/v1/type.proto +0 -214
  45. package/build/protos/protos.d.ts +0 -44031
  46. package/build/protos/protos.js +0 -122630
  47. package/build/protos/protos.json +0 -11631
  48. package/build/src/v1/database_admin_client.d.ts +0 -2367
  49. package/build/src/v1/database_admin_client.js +0 -2914
  50. package/build/src/v1/database_admin_client_config.json +0 -169
  51. package/build/src/v1/database_admin_proto_list.json +0 -6
  52. package/build/src/v1/gapic_metadata.json +0 -27
  53. package/build/src/v1/instance_admin_client.d.ts +0 -2106
  54. package/build/src/v1/instance_admin_client.js +0 -2387
  55. package/build/src/v1/instance_admin_client_config.json +0 -129
  56. package/build/src/v1/instance_admin_proto_list.json +0 -4
  57. package/build/src/v1/spanner_client.d.ts +0 -1319
  58. package/build/src/v1/spanner_client.js +0 -1446
  59. package/build/src/v1/spanner_client_config.json +0 -123
  60. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -419
  61. package/build/src/v1/spanner_executor_proxy_client.js +0 -728
  62. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  63. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -15
  64. package/build/src/v1/spanner_proto_list.json +0 -12
@@ -1,728 +0,0 @@
1
- "use strict";
2
- // Copyright 2026 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.SpannerExecutorProxyClient = void 0;
21
- const stream_1 = require("stream");
22
- const jsonProtos = require("../../protos/protos.json");
23
- const google_gax_1 = require("google-gax");
24
- /**
25
- * Client JSON configuration object, loaded from
26
- * `src/v1/spanner_executor_proxy_client_config.json`.
27
- * This file defines retry strategy and timeouts for all API methods in this library.
28
- */
29
- const gapicConfig = require("./spanner_executor_proxy_client_config.json");
30
- const version = require('../../../package.json').version;
31
- /**
32
- * Service that executes SpannerActions asynchronously.
33
- * @class
34
- * @memberof v1
35
- */
36
- class SpannerExecutorProxyClient {
37
- _terminated = false;
38
- _opts;
39
- _providedCustomServicePath;
40
- _gaxModule;
41
- _gaxGrpc;
42
- _protos;
43
- _defaults;
44
- _universeDomain;
45
- _servicePath;
46
- _log = google_gax_1.loggingUtils.log('executor');
47
- auth;
48
- descriptors = {
49
- page: {},
50
- stream: {},
51
- longrunning: {},
52
- batching: {},
53
- };
54
- warn;
55
- innerApiCalls;
56
- pathTemplates;
57
- spannerExecutorProxyStub;
58
- /**
59
- * Construct an instance of SpannerExecutorProxyClient.
60
- *
61
- * @param {object} [options] - The configuration object.
62
- * The options accepted by the constructor are described in detail
63
- * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
64
- * The common options are:
65
- * @param {object} [options.credentials] - Credentials object.
66
- * @param {string} [options.credentials.client_email]
67
- * @param {string} [options.credentials.private_key]
68
- * @param {string} [options.email] - Account email address. Required when
69
- * using a .pem or .p12 keyFilename.
70
- * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
71
- * .p12 key downloaded from the Google Developers Console. If you provide
72
- * a path to a JSON file, the projectId option below is not necessary.
73
- * NOTE: .pem and .p12 require you to specify options.email as well.
74
- * @param {number} [options.port] - The port on which to connect to
75
- * the remote host.
76
- * @param {string} [options.projectId] - The project ID from the Google
77
- * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
78
- * the environment variable GCLOUD_PROJECT for your project ID. If your
79
- * app is running in an environment which supports
80
- * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
81
- * your project ID will be detected automatically.
82
- * @param {string} [options.apiEndpoint] - The domain name of the
83
- * API remote host.
84
- * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
85
- * Follows the structure of {@link gapicConfig}.
86
- * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
87
- * For more information, please check the
88
- * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
89
- * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
90
- * need to avoid loading the default gRPC version and want to use the fallback
91
- * HTTP implementation. Load only fallback version and pass it to the constructor:
92
- * ```
93
- * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
94
- * const client = new SpannerExecutorProxyClient({fallback: true}, gax);
95
- * ```
96
- */
97
- constructor(opts, gaxInstance) {
98
- // Ensure that options include all the required fields.
99
- const staticMembers = this.constructor;
100
- if (opts?.universe_domain &&
101
- opts?.universeDomain &&
102
- opts?.universe_domain !== opts?.universeDomain) {
103
- throw new Error('Please set either universe_domain or universeDomain, but not both.');
104
- }
105
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
106
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
107
- : undefined;
108
- this._universeDomain =
109
- opts?.universeDomain ??
110
- opts?.universe_domain ??
111
- universeDomainEnvVar ??
112
- 'googleapis.com';
113
- this._servicePath = 'spanner-cloud-executor.' + this._universeDomain;
114
- const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
115
- this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
116
- const port = opts?.port || staticMembers.port;
117
- const clientConfig = opts?.clientConfig ?? {};
118
- const fallback = opts?.fallback ??
119
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
120
- opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
121
- // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
122
- if (servicePath !== this._servicePath && !('scopes' in opts)) {
123
- opts['scopes'] = staticMembers.scopes;
124
- }
125
- // Load google-gax module synchronously if needed
126
- if (!gaxInstance) {
127
- gaxInstance = require('google-gax');
128
- }
129
- // Choose either gRPC or proto-over-HTTP implementation of google-gax.
130
- this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
131
- // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
132
- this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
133
- // Save options to use in initialize() method.
134
- this._opts = opts;
135
- // Save the auth object to the client, for use by other methods.
136
- this.auth = this._gaxGrpc.auth;
137
- // Set useJWTAccessWithScope on the auth object.
138
- this.auth.useJWTAccessWithScope = true;
139
- // Set defaultServicePath on the auth object.
140
- this.auth.defaultServicePath = this._servicePath;
141
- // Set the default scopes in auth client if needed.
142
- if (servicePath === this._servicePath) {
143
- this.auth.defaultScopes = staticMembers.scopes;
144
- }
145
- // Determine the client header string.
146
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
147
- if (typeof process === 'object' && 'versions' in process) {
148
- clientHeader.push(`gl-node/${process.versions.node}`);
149
- }
150
- else {
151
- clientHeader.push(`gl-web/${this._gaxModule.version}`);
152
- }
153
- if (!opts.fallback) {
154
- clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
155
- }
156
- else {
157
- clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
158
- }
159
- if (opts.libName && opts.libVersion) {
160
- clientHeader.push(`${opts.libName}/${opts.libVersion}`);
161
- }
162
- // Load the applicable protos.
163
- this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
164
- // This API contains "path templates"; forward-slash-separated
165
- // identifiers to uniquely identify resources within the API.
166
- // Create useful helper objects for these.
167
- this.pathTemplates = {
168
- backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
169
- backupSchedulePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}'),
170
- databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
171
- databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
172
- instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
173
- instanceConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instanceConfigs/{instance_config}'),
174
- instancePartitionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/instancePartitions/{instance_partition}'),
175
- sessionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/sessions/{session}'),
176
- };
177
- // Some of the methods on this service provide streaming responses.
178
- // Provide descriptors for these.
179
- this.descriptors.stream = {
180
- executeActionAsync: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
181
- };
182
- // Put together the default options sent with requests.
183
- this._defaults = this._gaxGrpc.constructSettings('google.spanner.executor.v1.SpannerExecutorProxy', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
184
- // Set up a dictionary of "inner API calls"; the core implementation
185
- // of calling the API is handled in `google-gax`, with this code
186
- // merely providing the destination and request information.
187
- this.innerApiCalls = {};
188
- // Add a warn function to the client constructor so it can be easily tested.
189
- this.warn = this._gaxModule.warn;
190
- }
191
- /**
192
- * Initialize the client.
193
- * Performs asynchronous operations (such as authentication) and prepares the client.
194
- * This function will be called automatically when any class method is called for the
195
- * first time, but if you need to initialize it before calling an actual method,
196
- * feel free to call initialize() directly.
197
- *
198
- * You can await on this method if you want to make sure the client is initialized.
199
- *
200
- * @returns {Promise} A promise that resolves to an authenticated service stub.
201
- */
202
- initialize() {
203
- // If the client stub promise is already initialized, return immediately.
204
- if (this.spannerExecutorProxyStub) {
205
- return this.spannerExecutorProxyStub;
206
- }
207
- // Put together the "service stub" for
208
- // google.spanner.executor.v1.SpannerExecutorProxy.
209
- this.spannerExecutorProxyStub = this._gaxGrpc.createStub(this._opts.fallback
210
- ? this._protos.lookupService('google.spanner.executor.v1.SpannerExecutorProxy')
211
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
- this._protos.google.spanner.executor.v1.SpannerExecutorProxy, this._opts, this._providedCustomServicePath);
213
- // Iterate over each of the methods that the service provides
214
- // and create an API call method for each.
215
- const spannerExecutorProxyStubMethods = ['executeActionAsync'];
216
- for (const methodName of spannerExecutorProxyStubMethods) {
217
- const callPromise = this.spannerExecutorProxyStub.then(stub => (...args) => {
218
- if (this._terminated) {
219
- if (methodName in this.descriptors.stream) {
220
- const stream = new stream_1.PassThrough({ objectMode: true });
221
- setImmediate(() => {
222
- stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.'));
223
- });
224
- return stream;
225
- }
226
- return Promise.reject('The client has already been closed.');
227
- }
228
- const func = stub[methodName];
229
- return func.apply(stub, args);
230
- }, (err) => () => {
231
- throw err;
232
- });
233
- const descriptor = this.descriptors.stream[methodName] || undefined;
234
- const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
235
- this.innerApiCalls[methodName] = apiCall;
236
- }
237
- return this.spannerExecutorProxyStub;
238
- }
239
- /**
240
- * The DNS address for this API service.
241
- * @deprecated Use the apiEndpoint method of the client instance.
242
- * @returns {string} The DNS address for this service.
243
- */
244
- static get servicePath() {
245
- if (typeof process === 'object' &&
246
- typeof process.emitWarning === 'function') {
247
- process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
248
- }
249
- return 'spanner-cloud-executor.googleapis.com';
250
- }
251
- /**
252
- * The DNS address for this API service - same as servicePath.
253
- * @deprecated Use the apiEndpoint method of the client instance.
254
- * @returns {string} The DNS address for this service.
255
- */
256
- static get apiEndpoint() {
257
- if (typeof process === 'object' &&
258
- typeof process.emitWarning === 'function') {
259
- process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
260
- }
261
- return 'spanner-cloud-executor.googleapis.com';
262
- }
263
- /**
264
- * The DNS address for this API service.
265
- * @returns {string} The DNS address for this service.
266
- */
267
- get apiEndpoint() {
268
- return this._servicePath;
269
- }
270
- get universeDomain() {
271
- return this._universeDomain;
272
- }
273
- /**
274
- * The port for this API service.
275
- * @returns {number} The default port for this service.
276
- */
277
- static get port() {
278
- return 443;
279
- }
280
- /**
281
- * The scopes needed to make gRPC calls for every method defined
282
- * in this service.
283
- * @returns {string[]} List of default scopes.
284
- */
285
- static get scopes() {
286
- return [];
287
- }
288
- /**
289
- * Return the project ID used by this class.
290
- * @returns {Promise} A promise that resolves to string containing the project ID.
291
- */
292
- getProjectId(callback) {
293
- if (callback) {
294
- this.auth.getProjectId(callback);
295
- return;
296
- }
297
- return this.auth.getProjectId();
298
- }
299
- // -------------------
300
- // -- Service calls --
301
- // -------------------
302
- /**
303
- * ExecuteActionAsync is a streaming call that starts executing a new Spanner
304
- * action.
305
- *
306
- * For each request, the server will reply with one or more responses, but
307
- * only the last response will contain status in the outcome.
308
- *
309
- * Responses can be matched to requests by action_id. It is allowed to have
310
- * multiple actions in flight--in that case, actions are be executed in
311
- * parallel.
312
- *
313
- * @param {object} [options]
314
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
315
- * @returns {Stream}
316
- * An object stream which is both readable and writable. It accepts objects
317
- * representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionRequest|SpannerAsyncActionRequest} for write() method, and
318
- * will emit objects representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionResponse|SpannerAsyncActionResponse} on 'data' event asynchronously.
319
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation }
320
- * for more details and examples.
321
- * @example <caption>include:samples/generated/v1/spanner_executor_proxy.execute_action_async.js</caption>
322
- * region_tag:spanner-cloud-executor_v1_generated_SpannerExecutorProxy_ExecuteActionAsync_async
323
- */
324
- executeActionAsync(options) {
325
- this.initialize().catch(err => {
326
- throw err;
327
- });
328
- this._log.info('executeActionAsync stream %j', options);
329
- return this.innerApiCalls.executeActionAsync(null, options);
330
- }
331
- // --------------------
332
- // -- Path templates --
333
- // --------------------
334
- /**
335
- * Return a fully-qualified backup resource name string.
336
- *
337
- * @param {string} project
338
- * @param {string} instance
339
- * @param {string} backup
340
- * @returns {string} Resource name string.
341
- */
342
- backupPath(project, instance, backup) {
343
- return this.pathTemplates.backupPathTemplate.render({
344
- project: project,
345
- instance: instance,
346
- backup: backup,
347
- });
348
- }
349
- /**
350
- * Parse the project from Backup resource.
351
- *
352
- * @param {string} backupName
353
- * A fully-qualified path representing Backup resource.
354
- * @returns {string} A string representing the project.
355
- */
356
- matchProjectFromBackupName(backupName) {
357
- return this.pathTemplates.backupPathTemplate.match(backupName).project;
358
- }
359
- /**
360
- * Parse the instance from Backup resource.
361
- *
362
- * @param {string} backupName
363
- * A fully-qualified path representing Backup resource.
364
- * @returns {string} A string representing the instance.
365
- */
366
- matchInstanceFromBackupName(backupName) {
367
- return this.pathTemplates.backupPathTemplate.match(backupName).instance;
368
- }
369
- /**
370
- * Parse the backup from Backup resource.
371
- *
372
- * @param {string} backupName
373
- * A fully-qualified path representing Backup resource.
374
- * @returns {string} A string representing the backup.
375
- */
376
- matchBackupFromBackupName(backupName) {
377
- return this.pathTemplates.backupPathTemplate.match(backupName).backup;
378
- }
379
- /**
380
- * Return a fully-qualified backupSchedule resource name string.
381
- *
382
- * @param {string} project
383
- * @param {string} instance
384
- * @param {string} database
385
- * @param {string} schedule
386
- * @returns {string} Resource name string.
387
- */
388
- backupSchedulePath(project, instance, database, schedule) {
389
- return this.pathTemplates.backupSchedulePathTemplate.render({
390
- project: project,
391
- instance: instance,
392
- database: database,
393
- schedule: schedule,
394
- });
395
- }
396
- /**
397
- * Parse the project from BackupSchedule resource.
398
- *
399
- * @param {string} backupScheduleName
400
- * A fully-qualified path representing BackupSchedule resource.
401
- * @returns {string} A string representing the project.
402
- */
403
- matchProjectFromBackupScheduleName(backupScheduleName) {
404
- return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project;
405
- }
406
- /**
407
- * Parse the instance from BackupSchedule resource.
408
- *
409
- * @param {string} backupScheduleName
410
- * A fully-qualified path representing BackupSchedule resource.
411
- * @returns {string} A string representing the instance.
412
- */
413
- matchInstanceFromBackupScheduleName(backupScheduleName) {
414
- return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance;
415
- }
416
- /**
417
- * Parse the database from BackupSchedule resource.
418
- *
419
- * @param {string} backupScheduleName
420
- * A fully-qualified path representing BackupSchedule resource.
421
- * @returns {string} A string representing the database.
422
- */
423
- matchDatabaseFromBackupScheduleName(backupScheduleName) {
424
- return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database;
425
- }
426
- /**
427
- * Parse the schedule from BackupSchedule resource.
428
- *
429
- * @param {string} backupScheduleName
430
- * A fully-qualified path representing BackupSchedule resource.
431
- * @returns {string} A string representing the schedule.
432
- */
433
- matchScheduleFromBackupScheduleName(backupScheduleName) {
434
- return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule;
435
- }
436
- /**
437
- * Return a fully-qualified database resource name string.
438
- *
439
- * @param {string} project
440
- * @param {string} instance
441
- * @param {string} database
442
- * @returns {string} Resource name string.
443
- */
444
- databasePath(project, instance, database) {
445
- return this.pathTemplates.databasePathTemplate.render({
446
- project: project,
447
- instance: instance,
448
- database: database,
449
- });
450
- }
451
- /**
452
- * Parse the project from Database resource.
453
- *
454
- * @param {string} databaseName
455
- * A fully-qualified path representing Database resource.
456
- * @returns {string} A string representing the project.
457
- */
458
- matchProjectFromDatabaseName(databaseName) {
459
- return this.pathTemplates.databasePathTemplate.match(databaseName).project;
460
- }
461
- /**
462
- * Parse the instance from Database resource.
463
- *
464
- * @param {string} databaseName
465
- * A fully-qualified path representing Database resource.
466
- * @returns {string} A string representing the instance.
467
- */
468
- matchInstanceFromDatabaseName(databaseName) {
469
- return this.pathTemplates.databasePathTemplate.match(databaseName).instance;
470
- }
471
- /**
472
- * Parse the database from Database resource.
473
- *
474
- * @param {string} databaseName
475
- * A fully-qualified path representing Database resource.
476
- * @returns {string} A string representing the database.
477
- */
478
- matchDatabaseFromDatabaseName(databaseName) {
479
- return this.pathTemplates.databasePathTemplate.match(databaseName).database;
480
- }
481
- /**
482
- * Return a fully-qualified databaseRole resource name string.
483
- *
484
- * @param {string} project
485
- * @param {string} instance
486
- * @param {string} database
487
- * @param {string} role
488
- * @returns {string} Resource name string.
489
- */
490
- databaseRolePath(project, instance, database, role) {
491
- return this.pathTemplates.databaseRolePathTemplate.render({
492
- project: project,
493
- instance: instance,
494
- database: database,
495
- role: role,
496
- });
497
- }
498
- /**
499
- * Parse the project from DatabaseRole resource.
500
- *
501
- * @param {string} databaseRoleName
502
- * A fully-qualified path representing DatabaseRole resource.
503
- * @returns {string} A string representing the project.
504
- */
505
- matchProjectFromDatabaseRoleName(databaseRoleName) {
506
- return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
507
- .project;
508
- }
509
- /**
510
- * Parse the instance from DatabaseRole resource.
511
- *
512
- * @param {string} databaseRoleName
513
- * A fully-qualified path representing DatabaseRole resource.
514
- * @returns {string} A string representing the instance.
515
- */
516
- matchInstanceFromDatabaseRoleName(databaseRoleName) {
517
- return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
518
- .instance;
519
- }
520
- /**
521
- * Parse the database from DatabaseRole resource.
522
- *
523
- * @param {string} databaseRoleName
524
- * A fully-qualified path representing DatabaseRole resource.
525
- * @returns {string} A string representing the database.
526
- */
527
- matchDatabaseFromDatabaseRoleName(databaseRoleName) {
528
- return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
529
- .database;
530
- }
531
- /**
532
- * Parse the role from DatabaseRole resource.
533
- *
534
- * @param {string} databaseRoleName
535
- * A fully-qualified path representing DatabaseRole resource.
536
- * @returns {string} A string representing the role.
537
- */
538
- matchRoleFromDatabaseRoleName(databaseRoleName) {
539
- return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
540
- .role;
541
- }
542
- /**
543
- * Return a fully-qualified instance resource name string.
544
- *
545
- * @param {string} project
546
- * @param {string} instance
547
- * @returns {string} Resource name string.
548
- */
549
- instancePath(project, instance) {
550
- return this.pathTemplates.instancePathTemplate.render({
551
- project: project,
552
- instance: instance,
553
- });
554
- }
555
- /**
556
- * Parse the project from Instance resource.
557
- *
558
- * @param {string} instanceName
559
- * A fully-qualified path representing Instance resource.
560
- * @returns {string} A string representing the project.
561
- */
562
- matchProjectFromInstanceName(instanceName) {
563
- return this.pathTemplates.instancePathTemplate.match(instanceName).project;
564
- }
565
- /**
566
- * Parse the instance from Instance resource.
567
- *
568
- * @param {string} instanceName
569
- * A fully-qualified path representing Instance resource.
570
- * @returns {string} A string representing the instance.
571
- */
572
- matchInstanceFromInstanceName(instanceName) {
573
- return this.pathTemplates.instancePathTemplate.match(instanceName).instance;
574
- }
575
- /**
576
- * Return a fully-qualified instanceConfig resource name string.
577
- *
578
- * @param {string} project
579
- * @param {string} instance_config
580
- * @returns {string} Resource name string.
581
- */
582
- instanceConfigPath(project, instanceConfig) {
583
- return this.pathTemplates.instanceConfigPathTemplate.render({
584
- project: project,
585
- instance_config: instanceConfig,
586
- });
587
- }
588
- /**
589
- * Parse the project from InstanceConfig resource.
590
- *
591
- * @param {string} instanceConfigName
592
- * A fully-qualified path representing InstanceConfig resource.
593
- * @returns {string} A string representing the project.
594
- */
595
- matchProjectFromInstanceConfigName(instanceConfigName) {
596
- return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project;
597
- }
598
- /**
599
- * Parse the instance_config from InstanceConfig resource.
600
- *
601
- * @param {string} instanceConfigName
602
- * A fully-qualified path representing InstanceConfig resource.
603
- * @returns {string} A string representing the instance_config.
604
- */
605
- matchInstanceConfigFromInstanceConfigName(instanceConfigName) {
606
- return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config;
607
- }
608
- /**
609
- * Return a fully-qualified instancePartition resource name string.
610
- *
611
- * @param {string} project
612
- * @param {string} instance
613
- * @param {string} instance_partition
614
- * @returns {string} Resource name string.
615
- */
616
- instancePartitionPath(project, instance, instancePartition) {
617
- return this.pathTemplates.instancePartitionPathTemplate.render({
618
- project: project,
619
- instance: instance,
620
- instance_partition: instancePartition,
621
- });
622
- }
623
- /**
624
- * Parse the project from InstancePartition resource.
625
- *
626
- * @param {string} instancePartitionName
627
- * A fully-qualified path representing InstancePartition resource.
628
- * @returns {string} A string representing the project.
629
- */
630
- matchProjectFromInstancePartitionName(instancePartitionName) {
631
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project;
632
- }
633
- /**
634
- * Parse the instance from InstancePartition resource.
635
- *
636
- * @param {string} instancePartitionName
637
- * A fully-qualified path representing InstancePartition resource.
638
- * @returns {string} A string representing the instance.
639
- */
640
- matchInstanceFromInstancePartitionName(instancePartitionName) {
641
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance;
642
- }
643
- /**
644
- * Parse the instance_partition from InstancePartition resource.
645
- *
646
- * @param {string} instancePartitionName
647
- * A fully-qualified path representing InstancePartition resource.
648
- * @returns {string} A string representing the instance_partition.
649
- */
650
- matchInstancePartitionFromInstancePartitionName(instancePartitionName) {
651
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition;
652
- }
653
- /**
654
- * Return a fully-qualified session resource name string.
655
- *
656
- * @param {string} project
657
- * @param {string} instance
658
- * @param {string} database
659
- * @param {string} session
660
- * @returns {string} Resource name string.
661
- */
662
- sessionPath(project, instance, database, session) {
663
- return this.pathTemplates.sessionPathTemplate.render({
664
- project: project,
665
- instance: instance,
666
- database: database,
667
- session: session,
668
- });
669
- }
670
- /**
671
- * Parse the project from Session resource.
672
- *
673
- * @param {string} sessionName
674
- * A fully-qualified path representing Session resource.
675
- * @returns {string} A string representing the project.
676
- */
677
- matchProjectFromSessionName(sessionName) {
678
- return this.pathTemplates.sessionPathTemplate.match(sessionName).project;
679
- }
680
- /**
681
- * Parse the instance from Session resource.
682
- *
683
- * @param {string} sessionName
684
- * A fully-qualified path representing Session resource.
685
- * @returns {string} A string representing the instance.
686
- */
687
- matchInstanceFromSessionName(sessionName) {
688
- return this.pathTemplates.sessionPathTemplate.match(sessionName).instance;
689
- }
690
- /**
691
- * Parse the database from Session resource.
692
- *
693
- * @param {string} sessionName
694
- * A fully-qualified path representing Session resource.
695
- * @returns {string} A string representing the database.
696
- */
697
- matchDatabaseFromSessionName(sessionName) {
698
- return this.pathTemplates.sessionPathTemplate.match(sessionName).database;
699
- }
700
- /**
701
- * Parse the session from Session resource.
702
- *
703
- * @param {string} sessionName
704
- * A fully-qualified path representing Session resource.
705
- * @returns {string} A string representing the session.
706
- */
707
- matchSessionFromSessionName(sessionName) {
708
- return this.pathTemplates.sessionPathTemplate.match(sessionName).session;
709
- }
710
- /**
711
- * Terminate the gRPC channel and close the client.
712
- *
713
- * The client will no longer be usable and all future behavior is undefined.
714
- * @returns {Promise} A promise that resolves when the client is closed.
715
- */
716
- close() {
717
- if (this.spannerExecutorProxyStub && !this._terminated) {
718
- return this.spannerExecutorProxyStub.then(stub => {
719
- this._log.info('ending gRPC channel');
720
- this._terminated = true;
721
- stub.close();
722
- });
723
- }
724
- return Promise.resolve();
725
- }
726
- }
727
- exports.SpannerExecutorProxyClient = SpannerExecutorProxyClient;
728
- //# sourceMappingURL=spanner_executor_proxy_client.js.map