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