@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,1768 @@
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.InstanceAdminClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/instance_admin_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./instance_admin_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Cloud Spanner Instance Admin API
31
+ *
32
+ * The Cloud Spanner Instance Admin API can be used to create, delete,
33
+ * modify and list instances. Instances are dedicated Cloud Spanner serving
34
+ * and storage resources to be used by Cloud Spanner databases.
35
+ *
36
+ * Each instance has a "configuration", which dictates where the
37
+ * serving resources for the Cloud Spanner instance are located (e.g.,
38
+ * US-central, Europe). Configurations are created by Google based on
39
+ * resource availability.
40
+ *
41
+ * Cloud Spanner billing is based on the instances that exist and their
42
+ * sizes. After an instance exists, there are no additional
43
+ * per-database or per-operation charges for use of the instance
44
+ * (though there may be additional network bandwidth charges).
45
+ * Instances offer isolation: problems with databases in one instance
46
+ * will not affect other instances. However, within an instance
47
+ * databases can affect each other. For example, if one database in an
48
+ * instance receives a lot of requests and consumes most of the
49
+ * instance resources, fewer resources are available for other
50
+ * databases in that instance, and their performance may suffer.
51
+ * @class
52
+ * @memberof v1
53
+ */
54
+ class InstanceAdminClient {
55
+ /**
56
+ * Construct an instance of InstanceAdminClient.
57
+ *
58
+ * @param {object} [options] - The configuration object.
59
+ * The options accepted by the constructor are described in detail
60
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
61
+ * The common options are:
62
+ * @param {object} [options.credentials] - Credentials object.
63
+ * @param {string} [options.credentials.client_email]
64
+ * @param {string} [options.credentials.private_key]
65
+ * @param {string} [options.email] - Account email address. Required when
66
+ * using a .pem or .p12 keyFilename.
67
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
68
+ * .p12 key downloaded from the Google Developers Console. If you provide
69
+ * a path to a JSON file, the projectId option below is not necessary.
70
+ * NOTE: .pem and .p12 require you to specify options.email as well.
71
+ * @param {number} [options.port] - The port on which to connect to
72
+ * the remote host.
73
+ * @param {string} [options.projectId] - The project ID from the Google
74
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
75
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
76
+ * app is running in an environment which supports
77
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
78
+ * your project ID will be detected automatically.
79
+ * @param {string} [options.apiEndpoint] - The domain name of the
80
+ * API remote host.
81
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
82
+ * Follows the structure of {@link gapicConfig}.
83
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
84
+ * For more information, please check the
85
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
86
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
87
+ * need to avoid loading the default gRPC version and want to use the fallback
88
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
89
+ * ```
90
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
91
+ * const client = new InstanceAdminClient({fallback: true}, gax);
92
+ * ```
93
+ */
94
+ constructor(opts, gaxInstance) {
95
+ var _a, _b, _c, _d, _e;
96
+ this._terminated = false;
97
+ this.descriptors = {
98
+ page: {},
99
+ stream: {},
100
+ longrunning: {},
101
+ batching: {},
102
+ };
103
+ // Ensure that options include all the required fields.
104
+ const staticMembers = this.constructor;
105
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
106
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
107
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
108
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
109
+ }
110
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
111
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
112
+ : undefined;
113
+ this._universeDomain =
114
+ (_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';
115
+ this._servicePath = 'spanner.' + this._universeDomain;
116
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
117
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
118
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
119
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
120
+ 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');
121
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
+ // Request numeric enum values if REST transport is used.
123
+ opts.numericEnums = true;
124
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
125
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
126
+ opts['scopes'] = staticMembers.scopes;
127
+ }
128
+ // Load google-gax module synchronously if needed
129
+ if (!gaxInstance) {
130
+ gaxInstance = require('google-gax');
131
+ }
132
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
133
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
134
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
135
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
136
+ // Save options to use in initialize() method.
137
+ this._opts = opts;
138
+ // Save the auth object to the client, for use by other methods.
139
+ this.auth = this._gaxGrpc.auth;
140
+ // Set useJWTAccessWithScope on the auth object.
141
+ this.auth.useJWTAccessWithScope = true;
142
+ // Set defaultServicePath on the auth object.
143
+ this.auth.defaultServicePath = this._servicePath;
144
+ // Set the default scopes in auth client if needed.
145
+ if (servicePath === this._servicePath) {
146
+ this.auth.defaultScopes = staticMembers.scopes;
147
+ }
148
+ // Determine the client header string.
149
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
150
+ if (typeof process === 'object' && 'versions' in process) {
151
+ clientHeader.push(`gl-node/${process.versions.node}`);
152
+ }
153
+ else {
154
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
155
+ }
156
+ if (!opts.fallback) {
157
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
158
+ }
159
+ else {
160
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
161
+ }
162
+ if (opts.libName && opts.libVersion) {
163
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
164
+ }
165
+ // Load the applicable protos.
166
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
167
+ // This API contains "path templates"; forward-slash-separated
168
+ // identifiers to uniquely identify resources within the API.
169
+ // Create useful helper objects for these.
170
+ this.pathTemplates = {
171
+ instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
172
+ instanceConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instanceConfigs/{instance_config}'),
173
+ instancePartitionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/instancePartitions/{instance_partition}'),
174
+ projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
175
+ };
176
+ // Some of the methods on this service return "paged" results,
177
+ // (e.g. 50 results at a time, with tokens to get subsequent
178
+ // pages). Denote the keys used for pagination and results.
179
+ this.descriptors.page = {
180
+ listInstanceConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instanceConfigs'),
181
+ listInstanceConfigOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
182
+ listInstances: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'),
183
+ listInstancePartitions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instancePartitions'),
184
+ listInstancePartitionOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
185
+ };
186
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
187
+ // This API contains "long-running operations", which return a
188
+ // an Operation object that allows for tracking of the operation,
189
+ // rather than holding a request open.
190
+ const lroOptions = {
191
+ auth: this.auth,
192
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
193
+ };
194
+ if (opts.fallback) {
195
+ lroOptions.protoJson = protoFilesRoot;
196
+ lroOptions.httpRules = [
197
+ {
198
+ selector: 'google.longrunning.Operations.GetOperation',
199
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
200
+ additional_bindings: [
201
+ { get: '/v1/{name=projects/*/instances/*/operations/*}' },
202
+ ],
203
+ },
204
+ {
205
+ selector: 'google.longrunning.Operations.ListOperations',
206
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
207
+ additional_bindings: [
208
+ { get: '/v1/{name=projects/*/instances/*/operations}' },
209
+ ],
210
+ },
211
+ {
212
+ selector: 'google.longrunning.Operations.CancelOperation',
213
+ post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
214
+ additional_bindings: [
215
+ { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
216
+ ],
217
+ },
218
+ {
219
+ selector: 'google.longrunning.Operations.DeleteOperation',
220
+ delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
221
+ additional_bindings: [
222
+ { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
223
+ ],
224
+ },
225
+ ];
226
+ }
227
+ this.operationsClient = this._gaxModule
228
+ .lro(lroOptions)
229
+ .operationsClient(opts);
230
+ const createInstanceConfigResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstanceConfig');
231
+ const createInstanceConfigMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata');
232
+ const updateInstanceConfigResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstanceConfig');
233
+ const updateInstanceConfigMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata');
234
+ const createInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
235
+ const createInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceMetadata');
236
+ const updateInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
237
+ const updateInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstanceMetadata');
238
+ const createInstancePartitionResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstancePartition');
239
+ const createInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata');
240
+ const updateInstancePartitionResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstancePartition');
241
+ const updateInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata');
242
+ const moveInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.MoveInstanceResponse');
243
+ const moveInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.MoveInstanceMetadata');
244
+ this.descriptors.longrunning = {
245
+ createInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)),
246
+ updateInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)),
247
+ createInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), createInstanceMetadata.decode.bind(createInstanceMetadata)),
248
+ updateInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), updateInstanceMetadata.decode.bind(updateInstanceMetadata)),
249
+ createInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstancePartitionResponse.decode.bind(createInstancePartitionResponse), createInstancePartitionMetadata.decode.bind(createInstancePartitionMetadata)),
250
+ updateInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstancePartitionResponse.decode.bind(updateInstancePartitionResponse), updateInstancePartitionMetadata.decode.bind(updateInstancePartitionMetadata)),
251
+ moveInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, moveInstanceResponse.decode.bind(moveInstanceResponse), moveInstanceMetadata.decode.bind(moveInstanceMetadata)),
252
+ };
253
+ // Put together the default options sent with requests.
254
+ this._defaults = this._gaxGrpc.constructSettings('google.spanner.admin.instance.v1.InstanceAdmin', 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.instanceAdminStub) {
276
+ return this.instanceAdminStub;
277
+ }
278
+ // Put together the "service stub" for
279
+ // google.spanner.admin.instance.v1.InstanceAdmin.
280
+ this.instanceAdminStub = this._gaxGrpc.createStub(this._opts.fallback
281
+ ? this._protos.lookupService('google.spanner.admin.instance.v1.InstanceAdmin')
282
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
283
+ this._protos.google.spanner.admin.instance.v1.InstanceAdmin, 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 instanceAdminStubMethods = [
287
+ 'listInstanceConfigs',
288
+ 'getInstanceConfig',
289
+ 'createInstanceConfig',
290
+ 'updateInstanceConfig',
291
+ 'deleteInstanceConfig',
292
+ 'listInstanceConfigOperations',
293
+ 'listInstances',
294
+ 'listInstancePartitions',
295
+ 'getInstance',
296
+ 'createInstance',
297
+ 'updateInstance',
298
+ 'deleteInstance',
299
+ 'setIamPolicy',
300
+ 'getIamPolicy',
301
+ 'testIamPermissions',
302
+ 'getInstancePartition',
303
+ 'createInstancePartition',
304
+ 'deleteInstancePartition',
305
+ 'updateInstancePartition',
306
+ 'listInstancePartitionOperations',
307
+ 'moveInstance',
308
+ ];
309
+ for (const methodName of instanceAdminStubMethods) {
310
+ const callPromise = this.instanceAdminStub.then(stub => (...args) => {
311
+ if (this._terminated) {
312
+ return Promise.reject('The client has already been closed.');
313
+ }
314
+ const func = stub[methodName];
315
+ return func.apply(stub, args);
316
+ }, (err) => () => {
317
+ throw err;
318
+ });
319
+ const descriptor = this.descriptors.page[methodName] ||
320
+ this.descriptors.longrunning[methodName] ||
321
+ undefined;
322
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
323
+ this.innerApiCalls[methodName] = apiCall;
324
+ }
325
+ return this.instanceAdminStub;
326
+ }
327
+ /**
328
+ * The DNS address for this API service.
329
+ * @deprecated Use the apiEndpoint method of the client instance.
330
+ * @returns {string} The DNS address for this service.
331
+ */
332
+ static get servicePath() {
333
+ if (typeof process === 'object' &&
334
+ typeof process.emitWarning === 'function') {
335
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
336
+ }
337
+ return 'spanner.googleapis.com';
338
+ }
339
+ /**
340
+ * The DNS address for this API service - same as servicePath.
341
+ * @deprecated Use the apiEndpoint method of the client instance.
342
+ * @returns {string} The DNS address for this service.
343
+ */
344
+ static get apiEndpoint() {
345
+ if (typeof process === 'object' &&
346
+ typeof process.emitWarning === 'function') {
347
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
348
+ }
349
+ return 'spanner.googleapis.com';
350
+ }
351
+ /**
352
+ * The DNS address for this API service.
353
+ * @returns {string} The DNS address for this service.
354
+ */
355
+ get apiEndpoint() {
356
+ return this._servicePath;
357
+ }
358
+ get universeDomain() {
359
+ return this._universeDomain;
360
+ }
361
+ /**
362
+ * The port for this API service.
363
+ * @returns {number} The default port for this service.
364
+ */
365
+ static get port() {
366
+ return 443;
367
+ }
368
+ /**
369
+ * The scopes needed to make gRPC calls for every method defined
370
+ * in this service.
371
+ * @returns {string[]} List of default scopes.
372
+ */
373
+ static get scopes() {
374
+ return [
375
+ 'https://www.googleapis.com/auth/cloud-platform',
376
+ 'https://www.googleapis.com/auth/spanner.admin',
377
+ ];
378
+ }
379
+ /**
380
+ * Return the project ID used by this class.
381
+ * @returns {Promise} A promise that resolves to string containing the project ID.
382
+ */
383
+ getProjectId(callback) {
384
+ if (callback) {
385
+ this.auth.getProjectId(callback);
386
+ return;
387
+ }
388
+ return this.auth.getProjectId();
389
+ }
390
+ getInstanceConfig(request, optionsOrCallback, callback) {
391
+ var _a;
392
+ request = request || {};
393
+ let options;
394
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
395
+ callback = optionsOrCallback;
396
+ options = {};
397
+ }
398
+ else {
399
+ options = optionsOrCallback;
400
+ }
401
+ options = options || {};
402
+ options.otherArgs = options.otherArgs || {};
403
+ options.otherArgs.headers = options.otherArgs.headers || {};
404
+ options.otherArgs.headers['x-goog-request-params'] =
405
+ this._gaxModule.routingHeader.fromParams({
406
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
407
+ });
408
+ this.initialize();
409
+ return this.innerApiCalls.getInstanceConfig(request, options, callback);
410
+ }
411
+ deleteInstanceConfig(request, optionsOrCallback, callback) {
412
+ var _a;
413
+ request = request || {};
414
+ let options;
415
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
416
+ callback = optionsOrCallback;
417
+ options = {};
418
+ }
419
+ else {
420
+ options = optionsOrCallback;
421
+ }
422
+ options = options || {};
423
+ options.otherArgs = options.otherArgs || {};
424
+ options.otherArgs.headers = options.otherArgs.headers || {};
425
+ options.otherArgs.headers['x-goog-request-params'] =
426
+ this._gaxModule.routingHeader.fromParams({
427
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
428
+ });
429
+ this.initialize();
430
+ return this.innerApiCalls.deleteInstanceConfig(request, options, callback);
431
+ }
432
+ getInstance(request, optionsOrCallback, callback) {
433
+ var _a;
434
+ request = request || {};
435
+ let options;
436
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
437
+ callback = optionsOrCallback;
438
+ options = {};
439
+ }
440
+ else {
441
+ options = optionsOrCallback;
442
+ }
443
+ options = options || {};
444
+ options.otherArgs = options.otherArgs || {};
445
+ options.otherArgs.headers = options.otherArgs.headers || {};
446
+ options.otherArgs.headers['x-goog-request-params'] =
447
+ this._gaxModule.routingHeader.fromParams({
448
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
449
+ });
450
+ this.initialize();
451
+ return this.innerApiCalls.getInstance(request, options, callback);
452
+ }
453
+ deleteInstance(request, optionsOrCallback, callback) {
454
+ var _a;
455
+ request = request || {};
456
+ let options;
457
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
458
+ callback = optionsOrCallback;
459
+ options = {};
460
+ }
461
+ else {
462
+ options = optionsOrCallback;
463
+ }
464
+ options = options || {};
465
+ options.otherArgs = options.otherArgs || {};
466
+ options.otherArgs.headers = options.otherArgs.headers || {};
467
+ options.otherArgs.headers['x-goog-request-params'] =
468
+ this._gaxModule.routingHeader.fromParams({
469
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
470
+ });
471
+ this.initialize();
472
+ return this.innerApiCalls.deleteInstance(request, options, callback);
473
+ }
474
+ setIamPolicy(request, optionsOrCallback, callback) {
475
+ var _a;
476
+ request = request || {};
477
+ let options;
478
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
479
+ callback = optionsOrCallback;
480
+ options = {};
481
+ }
482
+ else {
483
+ options = optionsOrCallback;
484
+ }
485
+ options = options || {};
486
+ options.otherArgs = options.otherArgs || {};
487
+ options.otherArgs.headers = options.otherArgs.headers || {};
488
+ options.otherArgs.headers['x-goog-request-params'] =
489
+ this._gaxModule.routingHeader.fromParams({
490
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
491
+ });
492
+ this.initialize();
493
+ return this.innerApiCalls.setIamPolicy(request, options, callback);
494
+ }
495
+ getIamPolicy(request, optionsOrCallback, callback) {
496
+ var _a;
497
+ request = request || {};
498
+ let options;
499
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
500
+ callback = optionsOrCallback;
501
+ options = {};
502
+ }
503
+ else {
504
+ options = optionsOrCallback;
505
+ }
506
+ options = options || {};
507
+ options.otherArgs = options.otherArgs || {};
508
+ options.otherArgs.headers = options.otherArgs.headers || {};
509
+ options.otherArgs.headers['x-goog-request-params'] =
510
+ this._gaxModule.routingHeader.fromParams({
511
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
512
+ });
513
+ this.initialize();
514
+ return this.innerApiCalls.getIamPolicy(request, options, callback);
515
+ }
516
+ testIamPermissions(request, optionsOrCallback, callback) {
517
+ var _a;
518
+ request = request || {};
519
+ let options;
520
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
521
+ callback = optionsOrCallback;
522
+ options = {};
523
+ }
524
+ else {
525
+ options = optionsOrCallback;
526
+ }
527
+ options = options || {};
528
+ options.otherArgs = options.otherArgs || {};
529
+ options.otherArgs.headers = options.otherArgs.headers || {};
530
+ options.otherArgs.headers['x-goog-request-params'] =
531
+ this._gaxModule.routingHeader.fromParams({
532
+ resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
533
+ });
534
+ this.initialize();
535
+ return this.innerApiCalls.testIamPermissions(request, options, callback);
536
+ }
537
+ getInstancePartition(request, optionsOrCallback, callback) {
538
+ var _a;
539
+ request = request || {};
540
+ let options;
541
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
542
+ callback = optionsOrCallback;
543
+ options = {};
544
+ }
545
+ else {
546
+ options = optionsOrCallback;
547
+ }
548
+ options = options || {};
549
+ options.otherArgs = options.otherArgs || {};
550
+ options.otherArgs.headers = options.otherArgs.headers || {};
551
+ options.otherArgs.headers['x-goog-request-params'] =
552
+ this._gaxModule.routingHeader.fromParams({
553
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
554
+ });
555
+ this.initialize();
556
+ return this.innerApiCalls.getInstancePartition(request, options, callback);
557
+ }
558
+ deleteInstancePartition(request, optionsOrCallback, callback) {
559
+ var _a;
560
+ request = request || {};
561
+ let options;
562
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
563
+ callback = optionsOrCallback;
564
+ options = {};
565
+ }
566
+ else {
567
+ options = optionsOrCallback;
568
+ }
569
+ options = options || {};
570
+ options.otherArgs = options.otherArgs || {};
571
+ options.otherArgs.headers = options.otherArgs.headers || {};
572
+ options.otherArgs.headers['x-goog-request-params'] =
573
+ this._gaxModule.routingHeader.fromParams({
574
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
575
+ });
576
+ this.initialize();
577
+ return this.innerApiCalls.deleteInstancePartition(request, options, callback);
578
+ }
579
+ createInstanceConfig(request, optionsOrCallback, callback) {
580
+ var _a;
581
+ request = request || {};
582
+ let options;
583
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
584
+ callback = optionsOrCallback;
585
+ options = {};
586
+ }
587
+ else {
588
+ options = optionsOrCallback;
589
+ }
590
+ options = options || {};
591
+ options.otherArgs = options.otherArgs || {};
592
+ options.otherArgs.headers = options.otherArgs.headers || {};
593
+ options.otherArgs.headers['x-goog-request-params'] =
594
+ this._gaxModule.routingHeader.fromParams({
595
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
596
+ });
597
+ this.initialize();
598
+ return this.innerApiCalls.createInstanceConfig(request, options, callback);
599
+ }
600
+ /**
601
+ * Check the status of the long running operation returned by `createInstanceConfig()`.
602
+ * @param {String} name
603
+ * The operation name that will be passed.
604
+ * @returns {Promise} - The promise which resolves to an object.
605
+ * The decoded operation object has result and metadata field to get information from.
606
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
607
+ * for more details and examples.
608
+ */
609
+ async checkCreateInstanceConfigProgress(name) {
610
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
611
+ const [operation] = await this.operationsClient.getOperation(request);
612
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
613
+ return decodeOperation;
614
+ }
615
+ updateInstanceConfig(request, optionsOrCallback, callback) {
616
+ var _a;
617
+ request = request || {};
618
+ let options;
619
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
620
+ callback = optionsOrCallback;
621
+ options = {};
622
+ }
623
+ else {
624
+ options = optionsOrCallback;
625
+ }
626
+ options = options || {};
627
+ options.otherArgs = options.otherArgs || {};
628
+ options.otherArgs.headers = options.otherArgs.headers || {};
629
+ options.otherArgs.headers['x-goog-request-params'] =
630
+ this._gaxModule.routingHeader.fromParams({
631
+ 'instance_config.name': (_a = request.instanceConfig.name) !== null && _a !== void 0 ? _a : '',
632
+ });
633
+ this.initialize();
634
+ return this.innerApiCalls.updateInstanceConfig(request, options, callback);
635
+ }
636
+ /**
637
+ * Check the status of the long running operation returned by `updateInstanceConfig()`.
638
+ * @param {String} name
639
+ * The operation name that will be passed.
640
+ * @returns {Promise} - The promise which resolves to an object.
641
+ * The decoded operation object has result and metadata field to get information from.
642
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
643
+ * for more details and examples.
644
+ */
645
+ async checkUpdateInstanceConfigProgress(name) {
646
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
647
+ const [operation] = await this.operationsClient.getOperation(request);
648
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
649
+ return decodeOperation;
650
+ }
651
+ createInstance(request, optionsOrCallback, callback) {
652
+ var _a;
653
+ request = request || {};
654
+ let options;
655
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
656
+ callback = optionsOrCallback;
657
+ options = {};
658
+ }
659
+ else {
660
+ options = optionsOrCallback;
661
+ }
662
+ options = options || {};
663
+ options.otherArgs = options.otherArgs || {};
664
+ options.otherArgs.headers = options.otherArgs.headers || {};
665
+ options.otherArgs.headers['x-goog-request-params'] =
666
+ this._gaxModule.routingHeader.fromParams({
667
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
668
+ });
669
+ this.initialize();
670
+ return this.innerApiCalls.createInstance(request, options, callback);
671
+ }
672
+ /**
673
+ * Check the status of the long running operation returned by `createInstance()`.
674
+ * @param {String} name
675
+ * The operation name that will be passed.
676
+ * @returns {Promise} - The promise which resolves to an object.
677
+ * The decoded operation object has result and metadata field to get information from.
678
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
679
+ * for more details and examples.
680
+ */
681
+ async checkCreateInstanceProgress(name) {
682
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
683
+ const [operation] = await this.operationsClient.getOperation(request);
684
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings());
685
+ return decodeOperation;
686
+ }
687
+ updateInstance(request, optionsOrCallback, callback) {
688
+ var _a;
689
+ request = request || {};
690
+ let options;
691
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
692
+ callback = optionsOrCallback;
693
+ options = {};
694
+ }
695
+ else {
696
+ options = optionsOrCallback;
697
+ }
698
+ options = options || {};
699
+ options.otherArgs = options.otherArgs || {};
700
+ options.otherArgs.headers = options.otherArgs.headers || {};
701
+ options.otherArgs.headers['x-goog-request-params'] =
702
+ this._gaxModule.routingHeader.fromParams({
703
+ 'instance.name': (_a = request.instance.name) !== null && _a !== void 0 ? _a : '',
704
+ });
705
+ this.initialize();
706
+ return this.innerApiCalls.updateInstance(request, options, callback);
707
+ }
708
+ /**
709
+ * Check the status of the long running operation returned by `updateInstance()`.
710
+ * @param {String} name
711
+ * The operation name that will be passed.
712
+ * @returns {Promise} - The promise which resolves to an object.
713
+ * The decoded operation object has result and metadata field to get information from.
714
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
715
+ * for more details and examples.
716
+ */
717
+ async checkUpdateInstanceProgress(name) {
718
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
719
+ const [operation] = await this.operationsClient.getOperation(request);
720
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
721
+ return decodeOperation;
722
+ }
723
+ createInstancePartition(request, optionsOrCallback, callback) {
724
+ var _a;
725
+ request = request || {};
726
+ let options;
727
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
728
+ callback = optionsOrCallback;
729
+ options = {};
730
+ }
731
+ else {
732
+ options = optionsOrCallback;
733
+ }
734
+ options = options || {};
735
+ options.otherArgs = options.otherArgs || {};
736
+ options.otherArgs.headers = options.otherArgs.headers || {};
737
+ options.otherArgs.headers['x-goog-request-params'] =
738
+ this._gaxModule.routingHeader.fromParams({
739
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
740
+ });
741
+ this.initialize();
742
+ return this.innerApiCalls.createInstancePartition(request, options, callback);
743
+ }
744
+ /**
745
+ * Check the status of the long running operation returned by `createInstancePartition()`.
746
+ * @param {String} name
747
+ * The operation name that will be passed.
748
+ * @returns {Promise} - The promise which resolves to an object.
749
+ * The decoded operation object has result and metadata field to get information from.
750
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
751
+ * for more details and examples.
752
+ */
753
+ async checkCreateInstancePartitionProgress(name) {
754
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
755
+ const [operation] = await this.operationsClient.getOperation(request);
756
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings());
757
+ return decodeOperation;
758
+ }
759
+ updateInstancePartition(request, optionsOrCallback, callback) {
760
+ var _a;
761
+ request = request || {};
762
+ let options;
763
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
764
+ callback = optionsOrCallback;
765
+ options = {};
766
+ }
767
+ else {
768
+ options = optionsOrCallback;
769
+ }
770
+ options = options || {};
771
+ options.otherArgs = options.otherArgs || {};
772
+ options.otherArgs.headers = options.otherArgs.headers || {};
773
+ options.otherArgs.headers['x-goog-request-params'] =
774
+ this._gaxModule.routingHeader.fromParams({
775
+ 'instance_partition.name': (_a = request.instancePartition.name) !== null && _a !== void 0 ? _a : '',
776
+ });
777
+ this.initialize();
778
+ return this.innerApiCalls.updateInstancePartition(request, options, callback);
779
+ }
780
+ /**
781
+ * Check the status of the long running operation returned by `updateInstancePartition()`.
782
+ * @param {String} name
783
+ * The operation name that will be passed.
784
+ * @returns {Promise} - The promise which resolves to an object.
785
+ * The decoded operation object has result and metadata field to get information from.
786
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
787
+ * for more details and examples.
788
+ */
789
+ async checkUpdateInstancePartitionProgress(name) {
790
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
791
+ const [operation] = await this.operationsClient.getOperation(request);
792
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings());
793
+ return decodeOperation;
794
+ }
795
+ moveInstance(request, optionsOrCallback, callback) {
796
+ var _a;
797
+ request = request || {};
798
+ let options;
799
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
800
+ callback = optionsOrCallback;
801
+ options = {};
802
+ }
803
+ else {
804
+ options = optionsOrCallback;
805
+ }
806
+ options = options || {};
807
+ options.otherArgs = options.otherArgs || {};
808
+ options.otherArgs.headers = options.otherArgs.headers || {};
809
+ options.otherArgs.headers['x-goog-request-params'] =
810
+ this._gaxModule.routingHeader.fromParams({
811
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
812
+ });
813
+ this.initialize();
814
+ return this.innerApiCalls.moveInstance(request, options, callback);
815
+ }
816
+ /**
817
+ * Check the status of the long running operation returned by `moveInstance()`.
818
+ * @param {String} name
819
+ * The operation name that will be passed.
820
+ * @returns {Promise} - The promise which resolves to an object.
821
+ * The decoded operation object has result and metadata field to get information from.
822
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
823
+ * for more details and examples.
824
+ */
825
+ async checkMoveInstanceProgress(name) {
826
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
827
+ const [operation] = await this.operationsClient.getOperation(request);
828
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings());
829
+ return decodeOperation;
830
+ }
831
+ listInstanceConfigs(request, optionsOrCallback, callback) {
832
+ var _a;
833
+ request = request || {};
834
+ let options;
835
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
836
+ callback = optionsOrCallback;
837
+ options = {};
838
+ }
839
+ else {
840
+ options = optionsOrCallback;
841
+ }
842
+ options = options || {};
843
+ options.otherArgs = options.otherArgs || {};
844
+ options.otherArgs.headers = options.otherArgs.headers || {};
845
+ options.otherArgs.headers['x-goog-request-params'] =
846
+ this._gaxModule.routingHeader.fromParams({
847
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
848
+ });
849
+ this.initialize();
850
+ return this.innerApiCalls.listInstanceConfigs(request, options, callback);
851
+ }
852
+ /**
853
+ * Equivalent to `listInstanceConfigs`, but returns a NodeJS Stream object.
854
+ * @param {Object} request
855
+ * The request object that will be sent.
856
+ * @param {string} request.parent
857
+ * Required. The name of the project for which a list of supported instance
858
+ * configurations is requested. Values are of the form
859
+ * `projects/<project>`.
860
+ * @param {number} request.pageSize
861
+ * Number of instance configurations to be returned in the response. If 0 or
862
+ * less, defaults to the server's maximum allowed page size.
863
+ * @param {string} request.pageToken
864
+ * If non-empty, `page_token` should contain a
865
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token}
866
+ * from a previous
867
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}.
868
+ * @param {object} [options]
869
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
870
+ * @returns {Stream}
871
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig} on 'data' event.
872
+ * The client library will perform auto-pagination by default: it will call the API as many
873
+ * times as needed. Note that it can affect your quota.
874
+ * We recommend using `listInstanceConfigsAsync()`
875
+ * method described below for async iteration which you can stop as needed.
876
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
877
+ * for more details and examples.
878
+ */
879
+ listInstanceConfigsStream(request, options) {
880
+ var _a;
881
+ request = request || {};
882
+ options = options || {};
883
+ options.otherArgs = options.otherArgs || {};
884
+ options.otherArgs.headers = options.otherArgs.headers || {};
885
+ options.otherArgs.headers['x-goog-request-params'] =
886
+ this._gaxModule.routingHeader.fromParams({
887
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
888
+ });
889
+ const defaultCallSettings = this._defaults['listInstanceConfigs'];
890
+ const callSettings = defaultCallSettings.merge(options);
891
+ this.initialize();
892
+ return this.descriptors.page.listInstanceConfigs.createStream(this.innerApiCalls.listInstanceConfigs, request, callSettings);
893
+ }
894
+ /**
895
+ * Equivalent to `listInstanceConfigs`, but returns an iterable object.
896
+ *
897
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
898
+ * @param {Object} request
899
+ * The request object that will be sent.
900
+ * @param {string} request.parent
901
+ * Required. The name of the project for which a list of supported instance
902
+ * configurations is requested. Values are of the form
903
+ * `projects/<project>`.
904
+ * @param {number} request.pageSize
905
+ * Number of instance configurations to be returned in the response. If 0 or
906
+ * less, defaults to the server's maximum allowed page size.
907
+ * @param {string} request.pageToken
908
+ * If non-empty, `page_token` should contain a
909
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token}
910
+ * from a previous
911
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}.
912
+ * @param {object} [options]
913
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
914
+ * @returns {Object}
915
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
916
+ * When you iterate the returned iterable, each element will be an object representing
917
+ * {@link protos.google.spanner.admin.instance.v1.InstanceConfig|InstanceConfig}. The API will be called under the hood as needed, once per the page,
918
+ * so you can stop the iteration when you don't need more results.
919
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
920
+ * for more details and examples.
921
+ */
922
+ listInstanceConfigsAsync(request, options) {
923
+ var _a;
924
+ request = request || {};
925
+ options = options || {};
926
+ options.otherArgs = options.otherArgs || {};
927
+ options.otherArgs.headers = options.otherArgs.headers || {};
928
+ options.otherArgs.headers['x-goog-request-params'] =
929
+ this._gaxModule.routingHeader.fromParams({
930
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
931
+ });
932
+ const defaultCallSettings = this._defaults['listInstanceConfigs'];
933
+ const callSettings = defaultCallSettings.merge(options);
934
+ this.initialize();
935
+ return this.descriptors.page.listInstanceConfigs.asyncIterate(this.innerApiCalls['listInstanceConfigs'], request, callSettings);
936
+ }
937
+ listInstanceConfigOperations(request, optionsOrCallback, callback) {
938
+ var _a;
939
+ request = request || {};
940
+ let options;
941
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
942
+ callback = optionsOrCallback;
943
+ options = {};
944
+ }
945
+ else {
946
+ options = optionsOrCallback;
947
+ }
948
+ options = options || {};
949
+ options.otherArgs = options.otherArgs || {};
950
+ options.otherArgs.headers = options.otherArgs.headers || {};
951
+ options.otherArgs.headers['x-goog-request-params'] =
952
+ this._gaxModule.routingHeader.fromParams({
953
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
954
+ });
955
+ this.initialize();
956
+ return this.innerApiCalls.listInstanceConfigOperations(request, options, callback);
957
+ }
958
+ /**
959
+ * Equivalent to `listInstanceConfigOperations`, but returns a NodeJS Stream object.
960
+ * @param {Object} request
961
+ * The request object that will be sent.
962
+ * @param {string} request.parent
963
+ * Required. The project of the instance configuration operations.
964
+ * Values are of the form `projects/<project>`.
965
+ * @param {string} request.filter
966
+ * An expression that filters the list of returned operations.
967
+ *
968
+ * A filter expression consists of a field name, a
969
+ * comparison operator, and a value for filtering.
970
+ * The value must be a string, a number, or a boolean. The comparison operator
971
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
972
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
973
+ *
974
+ * The following fields in the Operation are eligible for filtering:
975
+ *
976
+ * * `name` - The name of the long-running operation
977
+ * * `done` - False if the operation is in progress, else true.
978
+ * * `metadata.@type` - the type of metadata. For example, the type string
979
+ * for
980
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
981
+ * is
982
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
983
+ * * `metadata.<field_name>` - any field in metadata.value.
984
+ * `metadata.@type` must be specified first, if filtering on metadata
985
+ * fields.
986
+ * * `error` - Error associated with the long-running operation.
987
+ * * `response.@type` - the type of response.
988
+ * * `response.<field_name>` - any field in response.value.
989
+ *
990
+ * You can combine multiple expressions by enclosing each expression in
991
+ * parentheses. By default, expressions are combined with AND logic. However,
992
+ * you can specify AND, OR, and NOT logic explicitly.
993
+ *
994
+ * Here are a few examples:
995
+ *
996
+ * * `done:true` - The operation is complete.
997
+ * * `(metadata.@type=` \
998
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
999
+ * AND` \
1000
+ * `(metadata.instance_config.name:custom-config) AND` \
1001
+ * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
1002
+ * `(error:*)` - Return operations where:
1003
+ * * The operation's metadata type is
1004
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
1005
+ * * The instance configuration name contains "custom-config".
1006
+ * * The operation started before 2021-03-28T14:50:00Z.
1007
+ * * The operation resulted in an error.
1008
+ * @param {number} request.pageSize
1009
+ * Number of operations to be returned in the response. If 0 or
1010
+ * less, defaults to the server's maximum allowed page size.
1011
+ * @param {string} request.pageToken
1012
+ * If non-empty, `page_token` should contain a
1013
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
1014
+ * from a previous
1015
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
1016
+ * to the same `parent` and with the same `filter`.
1017
+ * @param {object} [options]
1018
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1019
+ * @returns {Stream}
1020
+ * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1021
+ * The client library will perform auto-pagination by default: it will call the API as many
1022
+ * times as needed. Note that it can affect your quota.
1023
+ * We recommend using `listInstanceConfigOperationsAsync()`
1024
+ * method described below for async iteration which you can stop as needed.
1025
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1026
+ * for more details and examples.
1027
+ */
1028
+ listInstanceConfigOperationsStream(request, options) {
1029
+ var _a;
1030
+ request = request || {};
1031
+ options = options || {};
1032
+ options.otherArgs = options.otherArgs || {};
1033
+ options.otherArgs.headers = options.otherArgs.headers || {};
1034
+ options.otherArgs.headers['x-goog-request-params'] =
1035
+ this._gaxModule.routingHeader.fromParams({
1036
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1037
+ });
1038
+ const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1039
+ const callSettings = defaultCallSettings.merge(options);
1040
+ this.initialize();
1041
+ return this.descriptors.page.listInstanceConfigOperations.createStream(this.innerApiCalls.listInstanceConfigOperations, request, callSettings);
1042
+ }
1043
+ /**
1044
+ * Equivalent to `listInstanceConfigOperations`, but returns an iterable object.
1045
+ *
1046
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1047
+ * @param {Object} request
1048
+ * The request object that will be sent.
1049
+ * @param {string} request.parent
1050
+ * Required. The project of the instance configuration operations.
1051
+ * Values are of the form `projects/<project>`.
1052
+ * @param {string} request.filter
1053
+ * An expression that filters the list of returned operations.
1054
+ *
1055
+ * A filter expression consists of a field name, a
1056
+ * comparison operator, and a value for filtering.
1057
+ * The value must be a string, a number, or a boolean. The comparison operator
1058
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1059
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1060
+ *
1061
+ * The following fields in the Operation are eligible for filtering:
1062
+ *
1063
+ * * `name` - The name of the long-running operation
1064
+ * * `done` - False if the operation is in progress, else true.
1065
+ * * `metadata.@type` - the type of metadata. For example, the type string
1066
+ * for
1067
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
1068
+ * is
1069
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
1070
+ * * `metadata.<field_name>` - any field in metadata.value.
1071
+ * `metadata.@type` must be specified first, if filtering on metadata
1072
+ * fields.
1073
+ * * `error` - Error associated with the long-running operation.
1074
+ * * `response.@type` - the type of response.
1075
+ * * `response.<field_name>` - any field in response.value.
1076
+ *
1077
+ * You can combine multiple expressions by enclosing each expression in
1078
+ * parentheses. By default, expressions are combined with AND logic. However,
1079
+ * you can specify AND, OR, and NOT logic explicitly.
1080
+ *
1081
+ * Here are a few examples:
1082
+ *
1083
+ * * `done:true` - The operation is complete.
1084
+ * * `(metadata.@type=` \
1085
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
1086
+ * AND` \
1087
+ * `(metadata.instance_config.name:custom-config) AND` \
1088
+ * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
1089
+ * `(error:*)` - Return operations where:
1090
+ * * The operation's metadata type is
1091
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
1092
+ * * The instance configuration name contains "custom-config".
1093
+ * * The operation started before 2021-03-28T14:50:00Z.
1094
+ * * The operation resulted in an error.
1095
+ * @param {number} request.pageSize
1096
+ * Number of operations to be returned in the response. If 0 or
1097
+ * less, defaults to the server's maximum allowed page size.
1098
+ * @param {string} request.pageToken
1099
+ * If non-empty, `page_token` should contain a
1100
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
1101
+ * from a previous
1102
+ * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
1103
+ * to the same `parent` and with the same `filter`.
1104
+ * @param {object} [options]
1105
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1106
+ * @returns {Object}
1107
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1108
+ * When you iterate the returned iterable, each element will be an object representing
1109
+ * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1110
+ * so you can stop the iteration when you don't need more results.
1111
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1112
+ * for more details and examples.
1113
+ */
1114
+ listInstanceConfigOperationsAsync(request, options) {
1115
+ var _a;
1116
+ request = request || {};
1117
+ options = options || {};
1118
+ options.otherArgs = options.otherArgs || {};
1119
+ options.otherArgs.headers = options.otherArgs.headers || {};
1120
+ options.otherArgs.headers['x-goog-request-params'] =
1121
+ this._gaxModule.routingHeader.fromParams({
1122
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1123
+ });
1124
+ const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1125
+ const callSettings = defaultCallSettings.merge(options);
1126
+ this.initialize();
1127
+ return this.descriptors.page.listInstanceConfigOperations.asyncIterate(this.innerApiCalls['listInstanceConfigOperations'], request, callSettings);
1128
+ }
1129
+ listInstances(request, optionsOrCallback, callback) {
1130
+ var _a;
1131
+ request = request || {};
1132
+ let options;
1133
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1134
+ callback = optionsOrCallback;
1135
+ options = {};
1136
+ }
1137
+ else {
1138
+ options = optionsOrCallback;
1139
+ }
1140
+ options = options || {};
1141
+ options.otherArgs = options.otherArgs || {};
1142
+ options.otherArgs.headers = options.otherArgs.headers || {};
1143
+ options.otherArgs.headers['x-goog-request-params'] =
1144
+ this._gaxModule.routingHeader.fromParams({
1145
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1146
+ });
1147
+ this.initialize();
1148
+ return this.innerApiCalls.listInstances(request, options, callback);
1149
+ }
1150
+ /**
1151
+ * Equivalent to `listInstances`, but returns a NodeJS Stream object.
1152
+ * @param {Object} request
1153
+ * The request object that will be sent.
1154
+ * @param {string} request.parent
1155
+ * Required. The name of the project for which a list of instances is
1156
+ * requested. Values are of the form `projects/<project>`.
1157
+ * @param {number} request.pageSize
1158
+ * Number of instances to be returned in the response. If 0 or less, defaults
1159
+ * to the server's maximum allowed page size.
1160
+ * @param {string} request.pageToken
1161
+ * If non-empty, `page_token` should contain a
1162
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
1163
+ * from a previous
1164
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1165
+ * @param {string} request.filter
1166
+ * An expression for filtering the results of the request. Filter rules are
1167
+ * case insensitive. The fields eligible for filtering are:
1168
+ *
1169
+ * * `name`
1170
+ * * `display_name`
1171
+ * * `labels.key` where key is the name of a label
1172
+ *
1173
+ * Some examples of using filters are:
1174
+ *
1175
+ * * `name:*` --> The instance has a name.
1176
+ * * `name:Howl` --> The instance's name contains the string "howl".
1177
+ * * `name:HOWL` --> Equivalent to above.
1178
+ * * `NAME:howl` --> Equivalent to above.
1179
+ * * `labels.env:*` --> The instance has the label "env".
1180
+ * * `labels.env:dev` --> The instance has the label "env" and the value of
1181
+ * the label contains the string "dev".
1182
+ * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1183
+ * it has the label "env" with its value
1184
+ * containing "dev".
1185
+ * @param {google.protobuf.Timestamp} request.instanceDeadline
1186
+ * Deadline used while retrieving metadata for instances.
1187
+ * Instances whose metadata cannot be retrieved within this deadline will be
1188
+ * added to
1189
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1190
+ * in
1191
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1192
+ * @param {object} [options]
1193
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1194
+ * @returns {Stream}
1195
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance} on 'data' event.
1196
+ * The client library will perform auto-pagination by default: it will call the API as many
1197
+ * times as needed. Note that it can affect your quota.
1198
+ * We recommend using `listInstancesAsync()`
1199
+ * method described below for async iteration which you can stop as needed.
1200
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1201
+ * for more details and examples.
1202
+ */
1203
+ listInstancesStream(request, options) {
1204
+ var _a;
1205
+ request = request || {};
1206
+ options = options || {};
1207
+ options.otherArgs = options.otherArgs || {};
1208
+ options.otherArgs.headers = options.otherArgs.headers || {};
1209
+ options.otherArgs.headers['x-goog-request-params'] =
1210
+ this._gaxModule.routingHeader.fromParams({
1211
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1212
+ });
1213
+ const defaultCallSettings = this._defaults['listInstances'];
1214
+ const callSettings = defaultCallSettings.merge(options);
1215
+ this.initialize();
1216
+ return this.descriptors.page.listInstances.createStream(this.innerApiCalls.listInstances, request, callSettings);
1217
+ }
1218
+ /**
1219
+ * Equivalent to `listInstances`, but returns an iterable object.
1220
+ *
1221
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1222
+ * @param {Object} request
1223
+ * The request object that will be sent.
1224
+ * @param {string} request.parent
1225
+ * Required. The name of the project for which a list of instances is
1226
+ * requested. Values are of the form `projects/<project>`.
1227
+ * @param {number} request.pageSize
1228
+ * Number of instances to be returned in the response. If 0 or less, defaults
1229
+ * to the server's maximum allowed page size.
1230
+ * @param {string} request.pageToken
1231
+ * If non-empty, `page_token` should contain a
1232
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
1233
+ * from a previous
1234
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1235
+ * @param {string} request.filter
1236
+ * An expression for filtering the results of the request. Filter rules are
1237
+ * case insensitive. The fields eligible for filtering are:
1238
+ *
1239
+ * * `name`
1240
+ * * `display_name`
1241
+ * * `labels.key` where key is the name of a label
1242
+ *
1243
+ * Some examples of using filters are:
1244
+ *
1245
+ * * `name:*` --> The instance has a name.
1246
+ * * `name:Howl` --> The instance's name contains the string "howl".
1247
+ * * `name:HOWL` --> Equivalent to above.
1248
+ * * `NAME:howl` --> Equivalent to above.
1249
+ * * `labels.env:*` --> The instance has the label "env".
1250
+ * * `labels.env:dev` --> The instance has the label "env" and the value of
1251
+ * the label contains the string "dev".
1252
+ * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1253
+ * it has the label "env" with its value
1254
+ * containing "dev".
1255
+ * @param {google.protobuf.Timestamp} request.instanceDeadline
1256
+ * Deadline used while retrieving metadata for instances.
1257
+ * Instances whose metadata cannot be retrieved within this deadline will be
1258
+ * added to
1259
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1260
+ * in
1261
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1262
+ * @param {object} [options]
1263
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1264
+ * @returns {Object}
1265
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1266
+ * When you iterate the returned iterable, each element will be an object representing
1267
+ * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page,
1268
+ * so you can stop the iteration when you don't need more results.
1269
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1270
+ * for more details and examples.
1271
+ */
1272
+ listInstancesAsync(request, options) {
1273
+ var _a;
1274
+ request = request || {};
1275
+ options = options || {};
1276
+ options.otherArgs = options.otherArgs || {};
1277
+ options.otherArgs.headers = options.otherArgs.headers || {};
1278
+ options.otherArgs.headers['x-goog-request-params'] =
1279
+ this._gaxModule.routingHeader.fromParams({
1280
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1281
+ });
1282
+ const defaultCallSettings = this._defaults['listInstances'];
1283
+ const callSettings = defaultCallSettings.merge(options);
1284
+ this.initialize();
1285
+ return this.descriptors.page.listInstances.asyncIterate(this.innerApiCalls['listInstances'], request, callSettings);
1286
+ }
1287
+ listInstancePartitions(request, optionsOrCallback, callback) {
1288
+ var _a;
1289
+ request = request || {};
1290
+ let options;
1291
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1292
+ callback = optionsOrCallback;
1293
+ options = {};
1294
+ }
1295
+ else {
1296
+ options = optionsOrCallback;
1297
+ }
1298
+ options = options || {};
1299
+ options.otherArgs = options.otherArgs || {};
1300
+ options.otherArgs.headers = options.otherArgs.headers || {};
1301
+ options.otherArgs.headers['x-goog-request-params'] =
1302
+ this._gaxModule.routingHeader.fromParams({
1303
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1304
+ });
1305
+ this.initialize();
1306
+ return this.innerApiCalls.listInstancePartitions(request, options, callback);
1307
+ }
1308
+ /**
1309
+ * Equivalent to `listInstancePartitions`, but returns a NodeJS Stream object.
1310
+ * @param {Object} request
1311
+ * The request object that will be sent.
1312
+ * @param {string} request.parent
1313
+ * Required. The instance whose instance partitions should be listed. Values
1314
+ * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
1315
+ * = '-'` to list instance partitions for all Instances in a project, e.g.,
1316
+ * `projects/myproject/instances/-`.
1317
+ * @param {number} request.pageSize
1318
+ * Number of instance partitions to be returned in the response. If 0 or less,
1319
+ * defaults to the server's maximum allowed page size.
1320
+ * @param {string} request.pageToken
1321
+ * If non-empty, `page_token` should contain a
1322
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token}
1323
+ * from a previous
1324
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1325
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1326
+ * Optional. Deadline used while retrieving metadata for instance partitions.
1327
+ * Instance partitions whose metadata cannot be retrieved within this deadline
1328
+ * will be added to
1329
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable}
1330
+ * in
1331
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1332
+ * @param {object} [options]
1333
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1334
+ * @returns {Stream}
1335
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} on 'data' event.
1336
+ * The client library will perform auto-pagination by default: it will call the API as many
1337
+ * times as needed. Note that it can affect your quota.
1338
+ * We recommend using `listInstancePartitionsAsync()`
1339
+ * method described below for async iteration which you can stop as needed.
1340
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1341
+ * for more details and examples.
1342
+ */
1343
+ listInstancePartitionsStream(request, options) {
1344
+ var _a;
1345
+ request = request || {};
1346
+ options = options || {};
1347
+ options.otherArgs = options.otherArgs || {};
1348
+ options.otherArgs.headers = options.otherArgs.headers || {};
1349
+ options.otherArgs.headers['x-goog-request-params'] =
1350
+ this._gaxModule.routingHeader.fromParams({
1351
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1352
+ });
1353
+ const defaultCallSettings = this._defaults['listInstancePartitions'];
1354
+ const callSettings = defaultCallSettings.merge(options);
1355
+ this.initialize();
1356
+ return this.descriptors.page.listInstancePartitions.createStream(this.innerApiCalls.listInstancePartitions, request, callSettings);
1357
+ }
1358
+ /**
1359
+ * Equivalent to `listInstancePartitions`, but returns an iterable object.
1360
+ *
1361
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1362
+ * @param {Object} request
1363
+ * The request object that will be sent.
1364
+ * @param {string} request.parent
1365
+ * Required. The instance whose instance partitions should be listed. Values
1366
+ * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
1367
+ * = '-'` to list instance partitions for all Instances in a project, e.g.,
1368
+ * `projects/myproject/instances/-`.
1369
+ * @param {number} request.pageSize
1370
+ * Number of instance partitions to be returned in the response. If 0 or less,
1371
+ * defaults to the server's maximum allowed page size.
1372
+ * @param {string} request.pageToken
1373
+ * If non-empty, `page_token` should contain a
1374
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token}
1375
+ * from a previous
1376
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1377
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1378
+ * Optional. Deadline used while retrieving metadata for instance partitions.
1379
+ * Instance partitions whose metadata cannot be retrieved within this deadline
1380
+ * will be added to
1381
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable}
1382
+ * in
1383
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1384
+ * @param {object} [options]
1385
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1386
+ * @returns {Object}
1387
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1388
+ * When you iterate the returned iterable, each element will be an object representing
1389
+ * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. The API will be called under the hood as needed, once per the page,
1390
+ * so you can stop the iteration when you don't need more results.
1391
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1392
+ * for more details and examples.
1393
+ */
1394
+ listInstancePartitionsAsync(request, options) {
1395
+ var _a;
1396
+ request = request || {};
1397
+ options = options || {};
1398
+ options.otherArgs = options.otherArgs || {};
1399
+ options.otherArgs.headers = options.otherArgs.headers || {};
1400
+ options.otherArgs.headers['x-goog-request-params'] =
1401
+ this._gaxModule.routingHeader.fromParams({
1402
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1403
+ });
1404
+ const defaultCallSettings = this._defaults['listInstancePartitions'];
1405
+ const callSettings = defaultCallSettings.merge(options);
1406
+ this.initialize();
1407
+ return this.descriptors.page.listInstancePartitions.asyncIterate(this.innerApiCalls['listInstancePartitions'], request, callSettings);
1408
+ }
1409
+ listInstancePartitionOperations(request, optionsOrCallback, callback) {
1410
+ var _a;
1411
+ request = request || {};
1412
+ let options;
1413
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1414
+ callback = optionsOrCallback;
1415
+ options = {};
1416
+ }
1417
+ else {
1418
+ options = optionsOrCallback;
1419
+ }
1420
+ options = options || {};
1421
+ options.otherArgs = options.otherArgs || {};
1422
+ options.otherArgs.headers = options.otherArgs.headers || {};
1423
+ options.otherArgs.headers['x-goog-request-params'] =
1424
+ this._gaxModule.routingHeader.fromParams({
1425
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1426
+ });
1427
+ this.initialize();
1428
+ return this.innerApiCalls.listInstancePartitionOperations(request, options, callback);
1429
+ }
1430
+ /**
1431
+ * Equivalent to `listInstancePartitionOperations`, but returns a NodeJS Stream object.
1432
+ * @param {Object} request
1433
+ * The request object that will be sent.
1434
+ * @param {string} request.parent
1435
+ * Required. The parent instance of the instance partition operations.
1436
+ * Values are of the form `projects/<project>/instances/<instance>`.
1437
+ * @param {string} [request.filter]
1438
+ * Optional. An expression that filters the list of returned operations.
1439
+ *
1440
+ * A filter expression consists of a field name, a
1441
+ * comparison operator, and a value for filtering.
1442
+ * The value must be a string, a number, or a boolean. The comparison operator
1443
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1444
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1445
+ *
1446
+ * The following fields in the Operation are eligible for filtering:
1447
+ *
1448
+ * * `name` - The name of the long-running operation
1449
+ * * `done` - False if the operation is in progress, else true.
1450
+ * * `metadata.@type` - the type of metadata. For example, the type string
1451
+ * for
1452
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1453
+ * is
1454
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1455
+ * * `metadata.<field_name>` - any field in metadata.value.
1456
+ * `metadata.@type` must be specified first, if filtering on metadata
1457
+ * fields.
1458
+ * * `error` - Error associated with the long-running operation.
1459
+ * * `response.@type` - the type of response.
1460
+ * * `response.<field_name>` - any field in response.value.
1461
+ *
1462
+ * You can combine multiple expressions by enclosing each expression in
1463
+ * parentheses. By default, expressions are combined with AND logic. However,
1464
+ * you can specify AND, OR, and NOT logic explicitly.
1465
+ *
1466
+ * Here are a few examples:
1467
+ *
1468
+ * * `done:true` - The operation is complete.
1469
+ * * `(metadata.@type=` \
1470
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1471
+ * AND` \
1472
+ * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1473
+ * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1474
+ * `(error:*)` - Return operations where:
1475
+ * * The operation's metadata type is
1476
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1477
+ * * The instance partition name contains "custom-instance-partition".
1478
+ * * The operation started before 2021-03-28T14:50:00Z.
1479
+ * * The operation resulted in an error.
1480
+ * @param {number} [request.pageSize]
1481
+ * Optional. Number of operations to be returned in the response. If 0 or
1482
+ * less, defaults to the server's maximum allowed page size.
1483
+ * @param {string} [request.pageToken]
1484
+ * Optional. If non-empty, `page_token` should contain a
1485
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1486
+ * from a previous
1487
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1488
+ * to the same `parent` and with the same `filter`.
1489
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1490
+ * Optional. Deadline used while retrieving metadata for instance partition
1491
+ * operations. Instance partitions whose operation metadata cannot be
1492
+ * retrieved within this deadline will be added to
1493
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions}
1494
+ * in
1495
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1496
+ * @param {object} [options]
1497
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1498
+ * @returns {Stream}
1499
+ * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1500
+ * The client library will perform auto-pagination by default: it will call the API as many
1501
+ * times as needed. Note that it can affect your quota.
1502
+ * We recommend using `listInstancePartitionOperationsAsync()`
1503
+ * method described below for async iteration which you can stop as needed.
1504
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1505
+ * for more details and examples.
1506
+ */
1507
+ listInstancePartitionOperationsStream(request, options) {
1508
+ var _a;
1509
+ request = request || {};
1510
+ options = options || {};
1511
+ options.otherArgs = options.otherArgs || {};
1512
+ options.otherArgs.headers = options.otherArgs.headers || {};
1513
+ options.otherArgs.headers['x-goog-request-params'] =
1514
+ this._gaxModule.routingHeader.fromParams({
1515
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1516
+ });
1517
+ const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1518
+ const callSettings = defaultCallSettings.merge(options);
1519
+ this.initialize();
1520
+ return this.descriptors.page.listInstancePartitionOperations.createStream(this.innerApiCalls.listInstancePartitionOperations, request, callSettings);
1521
+ }
1522
+ /**
1523
+ * Equivalent to `listInstancePartitionOperations`, but returns an iterable object.
1524
+ *
1525
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1526
+ * @param {Object} request
1527
+ * The request object that will be sent.
1528
+ * @param {string} request.parent
1529
+ * Required. The parent instance of the instance partition operations.
1530
+ * Values are of the form `projects/<project>/instances/<instance>`.
1531
+ * @param {string} [request.filter]
1532
+ * Optional. An expression that filters the list of returned operations.
1533
+ *
1534
+ * A filter expression consists of a field name, a
1535
+ * comparison operator, and a value for filtering.
1536
+ * The value must be a string, a number, or a boolean. The comparison operator
1537
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1538
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1539
+ *
1540
+ * The following fields in the Operation are eligible for filtering:
1541
+ *
1542
+ * * `name` - The name of the long-running operation
1543
+ * * `done` - False if the operation is in progress, else true.
1544
+ * * `metadata.@type` - the type of metadata. For example, the type string
1545
+ * for
1546
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1547
+ * is
1548
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1549
+ * * `metadata.<field_name>` - any field in metadata.value.
1550
+ * `metadata.@type` must be specified first, if filtering on metadata
1551
+ * fields.
1552
+ * * `error` - Error associated with the long-running operation.
1553
+ * * `response.@type` - the type of response.
1554
+ * * `response.<field_name>` - any field in response.value.
1555
+ *
1556
+ * You can combine multiple expressions by enclosing each expression in
1557
+ * parentheses. By default, expressions are combined with AND logic. However,
1558
+ * you can specify AND, OR, and NOT logic explicitly.
1559
+ *
1560
+ * Here are a few examples:
1561
+ *
1562
+ * * `done:true` - The operation is complete.
1563
+ * * `(metadata.@type=` \
1564
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1565
+ * AND` \
1566
+ * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1567
+ * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1568
+ * `(error:*)` - Return operations where:
1569
+ * * The operation's metadata type is
1570
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1571
+ * * The instance partition name contains "custom-instance-partition".
1572
+ * * The operation started before 2021-03-28T14:50:00Z.
1573
+ * * The operation resulted in an error.
1574
+ * @param {number} [request.pageSize]
1575
+ * Optional. Number of operations to be returned in the response. If 0 or
1576
+ * less, defaults to the server's maximum allowed page size.
1577
+ * @param {string} [request.pageToken]
1578
+ * Optional. If non-empty, `page_token` should contain a
1579
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1580
+ * from a previous
1581
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1582
+ * to the same `parent` and with the same `filter`.
1583
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1584
+ * Optional. Deadline used while retrieving metadata for instance partition
1585
+ * operations. Instance partitions whose operation metadata cannot be
1586
+ * retrieved within this deadline will be added to
1587
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions|unreachable_instance_partitions}
1588
+ * in
1589
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1590
+ * @param {object} [options]
1591
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1592
+ * @returns {Object}
1593
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1594
+ * When you iterate the returned iterable, each element will be an object representing
1595
+ * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1596
+ * so you can stop the iteration when you don't need more results.
1597
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1598
+ * for more details and examples.
1599
+ */
1600
+ listInstancePartitionOperationsAsync(request, options) {
1601
+ var _a;
1602
+ request = request || {};
1603
+ options = options || {};
1604
+ options.otherArgs = options.otherArgs || {};
1605
+ options.otherArgs.headers = options.otherArgs.headers || {};
1606
+ options.otherArgs.headers['x-goog-request-params'] =
1607
+ this._gaxModule.routingHeader.fromParams({
1608
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1609
+ });
1610
+ const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1611
+ const callSettings = defaultCallSettings.merge(options);
1612
+ this.initialize();
1613
+ return this.descriptors.page.listInstancePartitionOperations.asyncIterate(this.innerApiCalls['listInstancePartitionOperations'], request, callSettings);
1614
+ }
1615
+ // --------------------
1616
+ // -- Path templates --
1617
+ // --------------------
1618
+ /**
1619
+ * Return a fully-qualified instance resource name string.
1620
+ *
1621
+ * @param {string} project
1622
+ * @param {string} instance
1623
+ * @returns {string} Resource name string.
1624
+ */
1625
+ instancePath(project, instance) {
1626
+ return this.pathTemplates.instancePathTemplate.render({
1627
+ project: project,
1628
+ instance: instance,
1629
+ });
1630
+ }
1631
+ /**
1632
+ * Parse the project from Instance resource.
1633
+ *
1634
+ * @param {string} instanceName
1635
+ * A fully-qualified path representing Instance resource.
1636
+ * @returns {string} A string representing the project.
1637
+ */
1638
+ matchProjectFromInstanceName(instanceName) {
1639
+ return this.pathTemplates.instancePathTemplate.match(instanceName).project;
1640
+ }
1641
+ /**
1642
+ * Parse the instance from Instance resource.
1643
+ *
1644
+ * @param {string} instanceName
1645
+ * A fully-qualified path representing Instance resource.
1646
+ * @returns {string} A string representing the instance.
1647
+ */
1648
+ matchInstanceFromInstanceName(instanceName) {
1649
+ return this.pathTemplates.instancePathTemplate.match(instanceName).instance;
1650
+ }
1651
+ /**
1652
+ * Return a fully-qualified instanceConfig resource name string.
1653
+ *
1654
+ * @param {string} project
1655
+ * @param {string} instance_config
1656
+ * @returns {string} Resource name string.
1657
+ */
1658
+ instanceConfigPath(project, instanceConfig) {
1659
+ return this.pathTemplates.instanceConfigPathTemplate.render({
1660
+ project: project,
1661
+ instance_config: instanceConfig,
1662
+ });
1663
+ }
1664
+ /**
1665
+ * Parse the project from InstanceConfig resource.
1666
+ *
1667
+ * @param {string} instanceConfigName
1668
+ * A fully-qualified path representing InstanceConfig resource.
1669
+ * @returns {string} A string representing the project.
1670
+ */
1671
+ matchProjectFromInstanceConfigName(instanceConfigName) {
1672
+ return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project;
1673
+ }
1674
+ /**
1675
+ * Parse the instance_config from InstanceConfig resource.
1676
+ *
1677
+ * @param {string} instanceConfigName
1678
+ * A fully-qualified path representing InstanceConfig resource.
1679
+ * @returns {string} A string representing the instance_config.
1680
+ */
1681
+ matchInstanceConfigFromInstanceConfigName(instanceConfigName) {
1682
+ return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config;
1683
+ }
1684
+ /**
1685
+ * Return a fully-qualified instancePartition resource name string.
1686
+ *
1687
+ * @param {string} project
1688
+ * @param {string} instance
1689
+ * @param {string} instance_partition
1690
+ * @returns {string} Resource name string.
1691
+ */
1692
+ instancePartitionPath(project, instance, instancePartition) {
1693
+ return this.pathTemplates.instancePartitionPathTemplate.render({
1694
+ project: project,
1695
+ instance: instance,
1696
+ instance_partition: instancePartition,
1697
+ });
1698
+ }
1699
+ /**
1700
+ * Parse the project from InstancePartition resource.
1701
+ *
1702
+ * @param {string} instancePartitionName
1703
+ * A fully-qualified path representing InstancePartition resource.
1704
+ * @returns {string} A string representing the project.
1705
+ */
1706
+ matchProjectFromInstancePartitionName(instancePartitionName) {
1707
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project;
1708
+ }
1709
+ /**
1710
+ * Parse the instance from InstancePartition resource.
1711
+ *
1712
+ * @param {string} instancePartitionName
1713
+ * A fully-qualified path representing InstancePartition resource.
1714
+ * @returns {string} A string representing the instance.
1715
+ */
1716
+ matchInstanceFromInstancePartitionName(instancePartitionName) {
1717
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance;
1718
+ }
1719
+ /**
1720
+ * Parse the instance_partition from InstancePartition resource.
1721
+ *
1722
+ * @param {string} instancePartitionName
1723
+ * A fully-qualified path representing InstancePartition resource.
1724
+ * @returns {string} A string representing the instance_partition.
1725
+ */
1726
+ matchInstancePartitionFromInstancePartitionName(instancePartitionName) {
1727
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition;
1728
+ }
1729
+ /**
1730
+ * Return a fully-qualified project resource name string.
1731
+ *
1732
+ * @param {string} project
1733
+ * @returns {string} Resource name string.
1734
+ */
1735
+ projectPath(project) {
1736
+ return this.pathTemplates.projectPathTemplate.render({
1737
+ project: project,
1738
+ });
1739
+ }
1740
+ /**
1741
+ * Parse the project from Project resource.
1742
+ *
1743
+ * @param {string} projectName
1744
+ * A fully-qualified path representing Project resource.
1745
+ * @returns {string} A string representing the project.
1746
+ */
1747
+ matchProjectFromProjectName(projectName) {
1748
+ return this.pathTemplates.projectPathTemplate.match(projectName).project;
1749
+ }
1750
+ /**
1751
+ * Terminate the gRPC channel and close the client.
1752
+ *
1753
+ * The client will no longer be usable and all future behavior is undefined.
1754
+ * @returns {Promise} A promise that resolves when the client is closed.
1755
+ */
1756
+ close() {
1757
+ if (this.instanceAdminStub && !this._terminated) {
1758
+ return this.instanceAdminStub.then(stub => {
1759
+ this._terminated = true;
1760
+ stub.close();
1761
+ this.operationsClient.close();
1762
+ });
1763
+ }
1764
+ return Promise.resolve();
1765
+ }
1766
+ }
1767
+ exports.InstanceAdminClient = InstanceAdminClient;
1768
+ //# sourceMappingURL=instance_admin_client.js.map