@google-cloud/spanner 7.17.1 → 7.18.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 (81) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -757
  4. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  5. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  6. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1209
  7. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -63
  8. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -1983
  9. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1520
  10. package/build/protos/google/spanner/v1/commit_response.proto +0 -59
  11. package/build/protos/google/spanner/v1/keys.proto +0 -163
  12. package/build/protos/google/spanner/v1/mutation.proto +0 -107
  13. package/build/protos/google/spanner/v1/query_plan.proto +0 -128
  14. package/build/protos/google/spanner/v1/result_set.proto +0 -237
  15. package/build/protos/google/spanner/v1/spanner.proto +0 -1389
  16. package/build/protos/google/spanner/v1/transaction.proto +0 -575
  17. package/build/protos/google/spanner/v1/type.proto +0 -210
  18. package/build/protos/protos.d.ts +0 -38999
  19. package/build/protos/protos.js +0 -99538
  20. package/build/protos/protos.json +0 -10182
  21. package/build/src/backup.d.ts +0 -349
  22. package/build/src/backup.js +0 -246
  23. package/build/src/batch-transaction.d.ts +0 -247
  24. package/build/src/batch-transaction.js +0 -384
  25. package/build/src/codec.d.ts +0 -362
  26. package/build/src/codec.js +0 -791
  27. package/build/src/common-grpc/service-object.d.ts +0 -80
  28. package/build/src/common-grpc/service-object.js +0 -101
  29. package/build/src/common-grpc/service.d.ts +0 -445
  30. package/build/src/common-grpc/service.js +0 -826
  31. package/build/src/common.d.ts +0 -66
  32. package/build/src/common.js +0 -54
  33. package/build/src/database.d.ts +0 -2104
  34. package/build/src/database.js +0 -1655
  35. package/build/src/extra_proto_list.json +0 -1
  36. package/build/src/helper.d.ts +0 -45
  37. package/build/src/helper.js +0 -71
  38. package/build/src/index.d.ts +0 -1195
  39. package/build/src/index.js +0 -1059
  40. package/build/src/instance-config.d.ts +0 -295
  41. package/build/src/instance-config.js +0 -216
  42. package/build/src/instance.d.ts +0 -833
  43. package/build/src/instance.js +0 -781
  44. package/build/src/instrument.d.ts +0 -85
  45. package/build/src/instrument.js +0 -212
  46. package/build/src/multiplexed-session.d.ts +0 -136
  47. package/build/src/multiplexed-session.js +0 -197
  48. package/build/src/partial-result-stream.d.ts +0 -253
  49. package/build/src/partial-result-stream.js +0 -400
  50. package/build/src/session-factory.d.ts +0 -101
  51. package/build/src/session-factory.js +0 -93
  52. package/build/src/session-pool.d.ts +0 -471
  53. package/build/src/session-pool.js +0 -754
  54. package/build/src/session.d.ts +0 -259
  55. package/build/src/session.js +0 -348
  56. package/build/src/spanner_grpc_config.json +0 -92
  57. package/build/src/table.d.ts +0 -831
  58. package/build/src/table.js +0 -277
  59. package/build/src/transaction-runner.d.ts +0 -185
  60. package/build/src/transaction-runner.js +0 -282
  61. package/build/src/transaction.d.ts +0 -1691
  62. package/build/src/transaction.js +0 -2004
  63. package/build/src/v1/database_admin_client.d.ts +0 -2301
  64. package/build/src/v1/database_admin_client.js +0 -2286
  65. package/build/src/v1/database_admin_client_config.json +0 -160
  66. package/build/src/v1/database_admin_proto_list.json +0 -6
  67. package/build/src/v1/gapic_metadata.json +0 -27
  68. package/build/src/v1/index.d.ts +0 -4
  69. package/build/src/v1/index.js +0 -29
  70. package/build/src/v1/instance_admin_client.d.ts +0 -1982
  71. package/build/src/v1/instance_admin_client.js +0 -1766
  72. package/build/src/v1/instance_admin_client_config.json +0 -129
  73. package/build/src/v1/instance_admin_proto_list.json +0 -4
  74. package/build/src/v1/spanner_client.d.ts +0 -1250
  75. package/build/src/v1/spanner_client.js +0 -1086
  76. package/build/src/v1/spanner_client_config.json +0 -119
  77. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -418
  78. package/build/src/v1/spanner_executor_proxy_client.js +0 -706
  79. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  80. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -14
  81. package/build/src/v1/spanner_proto_list.json +0 -10
@@ -1,1766 +0,0 @@
1
- "use strict";
2
- // Copyright 2024 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 `method.name.toCamelCase()`, 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 `method.name.toCamelCase()`, 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 {@link protos.google.longrunning.Operation|Operation}
975
- * are eligible for filtering:
976
- *
977
- * * `name` - The name of the long-running operation
978
- * * `done` - False if the operation is in progress, else true.
979
- * * `metadata.@type` - the type of metadata. For example, the type string
980
- * for
981
- * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
982
- * is
983
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
984
- * * `metadata.<field_name>` - any field in metadata.value.
985
- * `metadata.@type` must be specified first, if filtering on metadata
986
- * fields.
987
- * * `error` - Error associated with the long-running operation.
988
- * * `response.@type` - the type of response.
989
- * * `response.<field_name>` - any field in response.value.
990
- *
991
- * You can combine multiple expressions by enclosing each expression in
992
- * parentheses. By default, expressions are combined with AND logic. However,
993
- * you can specify AND, OR, and NOT logic explicitly.
994
- *
995
- * Here are a few examples:
996
- *
997
- * * `done:true` - The operation is complete.
998
- * * `(metadata.@type=` \
999
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
1000
- * AND` \
1001
- * `(metadata.instance_config.name:custom-config) AND` \
1002
- * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
1003
- * `(error:*)` - Return operations where:
1004
- * * The operation's metadata type is
1005
- * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
1006
- * * The instance configuration name contains "custom-config".
1007
- * * The operation started before 2021-03-28T14:50:00Z.
1008
- * * The operation resulted in an error.
1009
- * @param {number} request.pageSize
1010
- * Number of operations to be returned in the response. If 0 or
1011
- * less, defaults to the server's maximum allowed page size.
1012
- * @param {string} request.pageToken
1013
- * If non-empty, `page_token` should contain a
1014
- * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
1015
- * from a previous
1016
- * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
1017
- * to the same `parent` and with the same `filter`.
1018
- * @param {object} [options]
1019
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1020
- * @returns {Stream}
1021
- * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1022
- * The client library will perform auto-pagination by default: it will call the API as many
1023
- * times as needed. Note that it can affect your quota.
1024
- * We recommend using `listInstanceConfigOperationsAsync()`
1025
- * method described below for async iteration which you can stop as needed.
1026
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1027
- * for more details and examples.
1028
- */
1029
- listInstanceConfigOperationsStream(request, options) {
1030
- var _a;
1031
- request = request || {};
1032
- options = options || {};
1033
- options.otherArgs = options.otherArgs || {};
1034
- options.otherArgs.headers = options.otherArgs.headers || {};
1035
- options.otherArgs.headers['x-goog-request-params'] =
1036
- this._gaxModule.routingHeader.fromParams({
1037
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1038
- });
1039
- const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1040
- const callSettings = defaultCallSettings.merge(options);
1041
- this.initialize();
1042
- return this.descriptors.page.listInstanceConfigOperations.createStream(this.innerApiCalls.listInstanceConfigOperations, request, callSettings);
1043
- }
1044
- /**
1045
- * Equivalent to `listInstanceConfigOperations`, but returns an iterable object.
1046
- *
1047
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1048
- * @param {Object} request
1049
- * The request object that will be sent.
1050
- * @param {string} request.parent
1051
- * Required. The project of the instance configuration operations.
1052
- * Values are of the form `projects/<project>`.
1053
- * @param {string} request.filter
1054
- * An expression that filters the list of returned operations.
1055
- *
1056
- * A filter expression consists of a field name, a
1057
- * comparison operator, and a value for filtering.
1058
- * The value must be a string, a number, or a boolean. The comparison operator
1059
- * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1060
- * Colon `:` is the contains operator. Filter rules are not case sensitive.
1061
- *
1062
- * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1063
- * are eligible for filtering:
1064
- *
1065
- * * `name` - The name of the long-running operation
1066
- * * `done` - False if the operation is in progress, else true.
1067
- * * `metadata.@type` - the type of metadata. For example, the type string
1068
- * for
1069
- * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
1070
- * is
1071
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
1072
- * * `metadata.<field_name>` - any field in metadata.value.
1073
- * `metadata.@type` must be specified first, if filtering on metadata
1074
- * fields.
1075
- * * `error` - Error associated with the long-running operation.
1076
- * * `response.@type` - the type of response.
1077
- * * `response.<field_name>` - any field in response.value.
1078
- *
1079
- * You can combine multiple expressions by enclosing each expression in
1080
- * parentheses. By default, expressions are combined with AND logic. However,
1081
- * you can specify AND, OR, and NOT logic explicitly.
1082
- *
1083
- * Here are a few examples:
1084
- *
1085
- * * `done:true` - The operation is complete.
1086
- * * `(metadata.@type=` \
1087
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
1088
- * AND` \
1089
- * `(metadata.instance_config.name:custom-config) AND` \
1090
- * `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
1091
- * `(error:*)` - Return operations where:
1092
- * * The operation's metadata type is
1093
- * {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
1094
- * * The instance configuration name contains "custom-config".
1095
- * * The operation started before 2021-03-28T14:50:00Z.
1096
- * * The operation resulted in an error.
1097
- * @param {number} request.pageSize
1098
- * Number of operations to be returned in the response. If 0 or
1099
- * less, defaults to the server's maximum allowed page size.
1100
- * @param {string} request.pageToken
1101
- * If non-empty, `page_token` should contain a
1102
- * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
1103
- * from a previous
1104
- * {@link protos.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
1105
- * to the same `parent` and with the same `filter`.
1106
- * @param {object} [options]
1107
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1108
- * @returns {Object}
1109
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1110
- * When you iterate the returned iterable, each element will be an object representing
1111
- * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1112
- * so you can stop the iteration when you don't need more results.
1113
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1114
- * for more details and examples.
1115
- */
1116
- listInstanceConfigOperationsAsync(request, options) {
1117
- var _a;
1118
- request = request || {};
1119
- options = options || {};
1120
- options.otherArgs = options.otherArgs || {};
1121
- options.otherArgs.headers = options.otherArgs.headers || {};
1122
- options.otherArgs.headers['x-goog-request-params'] =
1123
- this._gaxModule.routingHeader.fromParams({
1124
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1125
- });
1126
- const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1127
- const callSettings = defaultCallSettings.merge(options);
1128
- this.initialize();
1129
- return this.descriptors.page.listInstanceConfigOperations.asyncIterate(this.innerApiCalls['listInstanceConfigOperations'], request, callSettings);
1130
- }
1131
- listInstances(request, optionsOrCallback, callback) {
1132
- var _a;
1133
- request = request || {};
1134
- let options;
1135
- if (typeof optionsOrCallback === 'function' && callback === undefined) {
1136
- callback = optionsOrCallback;
1137
- options = {};
1138
- }
1139
- else {
1140
- options = optionsOrCallback;
1141
- }
1142
- options = options || {};
1143
- options.otherArgs = options.otherArgs || {};
1144
- options.otherArgs.headers = options.otherArgs.headers || {};
1145
- options.otherArgs.headers['x-goog-request-params'] =
1146
- this._gaxModule.routingHeader.fromParams({
1147
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1148
- });
1149
- this.initialize();
1150
- return this.innerApiCalls.listInstances(request, options, callback);
1151
- }
1152
- /**
1153
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1154
- * @param {Object} request
1155
- * The request object that will be sent.
1156
- * @param {string} request.parent
1157
- * Required. The name of the project for which a list of instances is
1158
- * requested. Values are of the form `projects/<project>`.
1159
- * @param {number} request.pageSize
1160
- * Number of instances to be returned in the response. If 0 or less, defaults
1161
- * to the server's maximum allowed page size.
1162
- * @param {string} request.pageToken
1163
- * If non-empty, `page_token` should contain a
1164
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
1165
- * from a previous
1166
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1167
- * @param {string} request.filter
1168
- * An expression for filtering the results of the request. Filter rules are
1169
- * case insensitive. The fields eligible for filtering are:
1170
- *
1171
- * * `name`
1172
- * * `display_name`
1173
- * * `labels.key` where key is the name of a label
1174
- *
1175
- * Some examples of using filters are:
1176
- *
1177
- * * `name:*` --> The instance has a name.
1178
- * * `name:Howl` --> The instance's name contains the string "howl".
1179
- * * `name:HOWL` --> Equivalent to above.
1180
- * * `NAME:howl` --> Equivalent to above.
1181
- * * `labels.env:*` --> The instance has the label "env".
1182
- * * `labels.env:dev` --> The instance has the label "env" and the value of
1183
- * the label contains the string "dev".
1184
- * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1185
- * it has the label "env" with its value
1186
- * containing "dev".
1187
- * @param {google.protobuf.Timestamp} request.instanceDeadline
1188
- * Deadline used while retrieving metadata for instances.
1189
- * Instances whose metadata cannot be retrieved within this deadline will be
1190
- * added to
1191
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1192
- * in
1193
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1194
- * @param {object} [options]
1195
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1196
- * @returns {Stream}
1197
- * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.Instance|Instance} on 'data' event.
1198
- * The client library will perform auto-pagination by default: it will call the API as many
1199
- * times as needed. Note that it can affect your quota.
1200
- * We recommend using `listInstancesAsync()`
1201
- * method described below for async iteration which you can stop as needed.
1202
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1203
- * for more details and examples.
1204
- */
1205
- listInstancesStream(request, options) {
1206
- var _a;
1207
- request = request || {};
1208
- options = options || {};
1209
- options.otherArgs = options.otherArgs || {};
1210
- options.otherArgs.headers = options.otherArgs.headers || {};
1211
- options.otherArgs.headers['x-goog-request-params'] =
1212
- this._gaxModule.routingHeader.fromParams({
1213
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1214
- });
1215
- const defaultCallSettings = this._defaults['listInstances'];
1216
- const callSettings = defaultCallSettings.merge(options);
1217
- this.initialize();
1218
- return this.descriptors.page.listInstances.createStream(this.innerApiCalls.listInstances, request, callSettings);
1219
- }
1220
- /**
1221
- * Equivalent to `listInstances`, but returns an iterable object.
1222
- *
1223
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1224
- * @param {Object} request
1225
- * The request object that will be sent.
1226
- * @param {string} request.parent
1227
- * Required. The name of the project for which a list of instances is
1228
- * requested. Values are of the form `projects/<project>`.
1229
- * @param {number} request.pageSize
1230
- * Number of instances to be returned in the response. If 0 or less, defaults
1231
- * to the server's maximum allowed page size.
1232
- * @param {string} request.pageToken
1233
- * If non-empty, `page_token` should contain a
1234
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
1235
- * from a previous
1236
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1237
- * @param {string} request.filter
1238
- * An expression for filtering the results of the request. Filter rules are
1239
- * case insensitive. The fields eligible for filtering are:
1240
- *
1241
- * * `name`
1242
- * * `display_name`
1243
- * * `labels.key` where key is the name of a label
1244
- *
1245
- * Some examples of using filters are:
1246
- *
1247
- * * `name:*` --> The instance has a name.
1248
- * * `name:Howl` --> The instance's name contains the string "howl".
1249
- * * `name:HOWL` --> Equivalent to above.
1250
- * * `NAME:howl` --> Equivalent to above.
1251
- * * `labels.env:*` --> The instance has the label "env".
1252
- * * `labels.env:dev` --> The instance has the label "env" and the value of
1253
- * the label contains the string "dev".
1254
- * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1255
- * it has the label "env" with its value
1256
- * containing "dev".
1257
- * @param {google.protobuf.Timestamp} request.instanceDeadline
1258
- * Deadline used while retrieving metadata for instances.
1259
- * Instances whose metadata cannot be retrieved within this deadline will be
1260
- * added to
1261
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1262
- * in
1263
- * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1264
- * @param {object} [options]
1265
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1266
- * @returns {Object}
1267
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1268
- * When you iterate the returned iterable, each element will be an object representing
1269
- * {@link protos.google.spanner.admin.instance.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page,
1270
- * so you can stop the iteration when you don't need more results.
1271
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1272
- * for more details and examples.
1273
- */
1274
- listInstancesAsync(request, options) {
1275
- var _a;
1276
- request = request || {};
1277
- options = options || {};
1278
- options.otherArgs = options.otherArgs || {};
1279
- options.otherArgs.headers = options.otherArgs.headers || {};
1280
- options.otherArgs.headers['x-goog-request-params'] =
1281
- this._gaxModule.routingHeader.fromParams({
1282
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1283
- });
1284
- const defaultCallSettings = this._defaults['listInstances'];
1285
- const callSettings = defaultCallSettings.merge(options);
1286
- this.initialize();
1287
- return this.descriptors.page.listInstances.asyncIterate(this.innerApiCalls['listInstances'], request, callSettings);
1288
- }
1289
- listInstancePartitions(request, optionsOrCallback, callback) {
1290
- var _a;
1291
- request = request || {};
1292
- let options;
1293
- if (typeof optionsOrCallback === 'function' && callback === undefined) {
1294
- callback = optionsOrCallback;
1295
- options = {};
1296
- }
1297
- else {
1298
- options = optionsOrCallback;
1299
- }
1300
- options = options || {};
1301
- options.otherArgs = options.otherArgs || {};
1302
- options.otherArgs.headers = options.otherArgs.headers || {};
1303
- options.otherArgs.headers['x-goog-request-params'] =
1304
- this._gaxModule.routingHeader.fromParams({
1305
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1306
- });
1307
- this.initialize();
1308
- return this.innerApiCalls.listInstancePartitions(request, options, callback);
1309
- }
1310
- /**
1311
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1312
- * @param {Object} request
1313
- * The request object that will be sent.
1314
- * @param {string} request.parent
1315
- * Required. The instance whose instance partitions should be listed. Values
1316
- * are of the form `projects/<project>/instances/<instance>`.
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>`.
1367
- * @param {number} request.pageSize
1368
- * Number of instance partitions to be returned in the response. If 0 or less,
1369
- * defaults to the server's maximum allowed page size.
1370
- * @param {string} request.pageToken
1371
- * If non-empty, `page_token` should contain a
1372
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token}
1373
- * from a previous
1374
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1375
- * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1376
- * Optional. Deadline used while retrieving metadata for instance partitions.
1377
- * Instance partitions whose metadata cannot be retrieved within this deadline
1378
- * will be added to
1379
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable}
1380
- * in
1381
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1382
- * @param {object} [options]
1383
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1384
- * @returns {Object}
1385
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1386
- * When you iterate the returned iterable, each element will be an object representing
1387
- * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. The API will be called under the hood as needed, once per the page,
1388
- * so you can stop the iteration when you don't need more results.
1389
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1390
- * for more details and examples.
1391
- */
1392
- listInstancePartitionsAsync(request, options) {
1393
- var _a;
1394
- request = request || {};
1395
- options = options || {};
1396
- options.otherArgs = options.otherArgs || {};
1397
- options.otherArgs.headers = options.otherArgs.headers || {};
1398
- options.otherArgs.headers['x-goog-request-params'] =
1399
- this._gaxModule.routingHeader.fromParams({
1400
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1401
- });
1402
- const defaultCallSettings = this._defaults['listInstancePartitions'];
1403
- const callSettings = defaultCallSettings.merge(options);
1404
- this.initialize();
1405
- return this.descriptors.page.listInstancePartitions.asyncIterate(this.innerApiCalls['listInstancePartitions'], request, callSettings);
1406
- }
1407
- listInstancePartitionOperations(request, optionsOrCallback, callback) {
1408
- var _a;
1409
- request = request || {};
1410
- let options;
1411
- if (typeof optionsOrCallback === 'function' && callback === undefined) {
1412
- callback = optionsOrCallback;
1413
- options = {};
1414
- }
1415
- else {
1416
- options = optionsOrCallback;
1417
- }
1418
- options = options || {};
1419
- options.otherArgs = options.otherArgs || {};
1420
- options.otherArgs.headers = options.otherArgs.headers || {};
1421
- options.otherArgs.headers['x-goog-request-params'] =
1422
- this._gaxModule.routingHeader.fromParams({
1423
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1424
- });
1425
- this.initialize();
1426
- return this.innerApiCalls.listInstancePartitionOperations(request, options, callback);
1427
- }
1428
- /**
1429
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1430
- * @param {Object} request
1431
- * The request object that will be sent.
1432
- * @param {string} request.parent
1433
- * Required. The parent instance of the instance partition operations.
1434
- * Values are of the form `projects/<project>/instances/<instance>`.
1435
- * @param {string} [request.filter]
1436
- * Optional. An expression that filters the list of returned operations.
1437
- *
1438
- * A filter expression consists of a field name, a
1439
- * comparison operator, and a value for filtering.
1440
- * The value must be a string, a number, or a boolean. The comparison operator
1441
- * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1442
- * Colon `:` is the contains operator. Filter rules are not case sensitive.
1443
- *
1444
- * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1445
- * are eligible for filtering:
1446
- *
1447
- * * `name` - The name of the long-running operation
1448
- * * `done` - False if the operation is in progress, else true.
1449
- * * `metadata.@type` - the type of metadata. For example, the type string
1450
- * for
1451
- * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1452
- * is
1453
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1454
- * * `metadata.<field_name>` - any field in metadata.value.
1455
- * `metadata.@type` must be specified first, if filtering on metadata
1456
- * fields.
1457
- * * `error` - Error associated with the long-running operation.
1458
- * * `response.@type` - the type of response.
1459
- * * `response.<field_name>` - any field in response.value.
1460
- *
1461
- * You can combine multiple expressions by enclosing each expression in
1462
- * parentheses. By default, expressions are combined with AND logic. However,
1463
- * you can specify AND, OR, and NOT logic explicitly.
1464
- *
1465
- * Here are a few examples:
1466
- *
1467
- * * `done:true` - The operation is complete.
1468
- * * `(metadata.@type=` \
1469
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1470
- * AND` \
1471
- * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1472
- * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1473
- * `(error:*)` - Return operations where:
1474
- * * The operation's metadata type is
1475
- * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1476
- * * The instance partition name contains "custom-instance-partition".
1477
- * * The operation started before 2021-03-28T14:50:00Z.
1478
- * * The operation resulted in an error.
1479
- * @param {number} [request.pageSize]
1480
- * Optional. Number of operations to be returned in the response. If 0 or
1481
- * less, defaults to the server's maximum allowed page size.
1482
- * @param {string} [request.pageToken]
1483
- * Optional. If non-empty, `page_token` should contain a
1484
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1485
- * from a previous
1486
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1487
- * to the same `parent` and with the same `filter`.
1488
- * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1489
- * Optional. Deadline used while retrieving metadata for instance partition
1490
- * operations. Instance partitions whose operation metadata cannot be
1491
- * retrieved within this deadline will be added to
1492
- * {@link protos.ListInstancePartitionOperationsResponse.unreachable|unreachable} in
1493
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1494
- * @param {object} [options]
1495
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1496
- * @returns {Stream}
1497
- * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1498
- * The client library will perform auto-pagination by default: it will call the API as many
1499
- * times as needed. Note that it can affect your quota.
1500
- * We recommend using `listInstancePartitionOperationsAsync()`
1501
- * method described below for async iteration which you can stop as needed.
1502
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1503
- * for more details and examples.
1504
- */
1505
- listInstancePartitionOperationsStream(request, options) {
1506
- var _a;
1507
- request = request || {};
1508
- options = options || {};
1509
- options.otherArgs = options.otherArgs || {};
1510
- options.otherArgs.headers = options.otherArgs.headers || {};
1511
- options.otherArgs.headers['x-goog-request-params'] =
1512
- this._gaxModule.routingHeader.fromParams({
1513
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1514
- });
1515
- const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1516
- const callSettings = defaultCallSettings.merge(options);
1517
- this.initialize();
1518
- return this.descriptors.page.listInstancePartitionOperations.createStream(this.innerApiCalls.listInstancePartitionOperations, request, callSettings);
1519
- }
1520
- /**
1521
- * Equivalent to `listInstancePartitionOperations`, but returns an iterable object.
1522
- *
1523
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1524
- * @param {Object} request
1525
- * The request object that will be sent.
1526
- * @param {string} request.parent
1527
- * Required. The parent instance of the instance partition operations.
1528
- * Values are of the form `projects/<project>/instances/<instance>`.
1529
- * @param {string} [request.filter]
1530
- * Optional. An expression that filters the list of returned operations.
1531
- *
1532
- * A filter expression consists of a field name, a
1533
- * comparison operator, and a value for filtering.
1534
- * The value must be a string, a number, or a boolean. The comparison operator
1535
- * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1536
- * Colon `:` is the contains operator. Filter rules are not case sensitive.
1537
- *
1538
- * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1539
- * are eligible for filtering:
1540
- *
1541
- * * `name` - The name of the long-running operation
1542
- * * `done` - False if the operation is in progress, else true.
1543
- * * `metadata.@type` - the type of metadata. For example, the type string
1544
- * for
1545
- * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1546
- * is
1547
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1548
- * * `metadata.<field_name>` - any field in metadata.value.
1549
- * `metadata.@type` must be specified first, if filtering on metadata
1550
- * fields.
1551
- * * `error` - Error associated with the long-running operation.
1552
- * * `response.@type` - the type of response.
1553
- * * `response.<field_name>` - any field in response.value.
1554
- *
1555
- * You can combine multiple expressions by enclosing each expression in
1556
- * parentheses. By default, expressions are combined with AND logic. However,
1557
- * you can specify AND, OR, and NOT logic explicitly.
1558
- *
1559
- * Here are a few examples:
1560
- *
1561
- * * `done:true` - The operation is complete.
1562
- * * `(metadata.@type=` \
1563
- * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1564
- * AND` \
1565
- * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1566
- * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1567
- * `(error:*)` - Return operations where:
1568
- * * The operation's metadata type is
1569
- * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1570
- * * The instance partition name contains "custom-instance-partition".
1571
- * * The operation started before 2021-03-28T14:50:00Z.
1572
- * * The operation resulted in an error.
1573
- * @param {number} [request.pageSize]
1574
- * Optional. Number of operations to be returned in the response. If 0 or
1575
- * less, defaults to the server's maximum allowed page size.
1576
- * @param {string} [request.pageToken]
1577
- * Optional. If non-empty, `page_token` should contain a
1578
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1579
- * from a previous
1580
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1581
- * to the same `parent` and with the same `filter`.
1582
- * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1583
- * Optional. Deadline used while retrieving metadata for instance partition
1584
- * operations. Instance partitions whose operation metadata cannot be
1585
- * retrieved within this deadline will be added to
1586
- * {@link protos.ListInstancePartitionOperationsResponse.unreachable|unreachable} in
1587
- * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1588
- * @param {object} [options]
1589
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1590
- * @returns {Object}
1591
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1592
- * When you iterate the returned iterable, each element will be an object representing
1593
- * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1594
- * so you can stop the iteration when you don't need more results.
1595
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1596
- * for more details and examples.
1597
- */
1598
- listInstancePartitionOperationsAsync(request, options) {
1599
- var _a;
1600
- request = request || {};
1601
- options = options || {};
1602
- options.otherArgs = options.otherArgs || {};
1603
- options.otherArgs.headers = options.otherArgs.headers || {};
1604
- options.otherArgs.headers['x-goog-request-params'] =
1605
- this._gaxModule.routingHeader.fromParams({
1606
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1607
- });
1608
- const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1609
- const callSettings = defaultCallSettings.merge(options);
1610
- this.initialize();
1611
- return this.descriptors.page.listInstancePartitionOperations.asyncIterate(this.innerApiCalls['listInstancePartitionOperations'], request, callSettings);
1612
- }
1613
- // --------------------
1614
- // -- Path templates --
1615
- // --------------------
1616
- /**
1617
- * Return a fully-qualified instance resource name string.
1618
- *
1619
- * @param {string} project
1620
- * @param {string} instance
1621
- * @returns {string} Resource name string.
1622
- */
1623
- instancePath(project, instance) {
1624
- return this.pathTemplates.instancePathTemplate.render({
1625
- project: project,
1626
- instance: instance,
1627
- });
1628
- }
1629
- /**
1630
- * Parse the project from Instance resource.
1631
- *
1632
- * @param {string} instanceName
1633
- * A fully-qualified path representing Instance resource.
1634
- * @returns {string} A string representing the project.
1635
- */
1636
- matchProjectFromInstanceName(instanceName) {
1637
- return this.pathTemplates.instancePathTemplate.match(instanceName).project;
1638
- }
1639
- /**
1640
- * Parse the instance from Instance resource.
1641
- *
1642
- * @param {string} instanceName
1643
- * A fully-qualified path representing Instance resource.
1644
- * @returns {string} A string representing the instance.
1645
- */
1646
- matchInstanceFromInstanceName(instanceName) {
1647
- return this.pathTemplates.instancePathTemplate.match(instanceName).instance;
1648
- }
1649
- /**
1650
- * Return a fully-qualified instanceConfig resource name string.
1651
- *
1652
- * @param {string} project
1653
- * @param {string} instance_config
1654
- * @returns {string} Resource name string.
1655
- */
1656
- instanceConfigPath(project, instanceConfig) {
1657
- return this.pathTemplates.instanceConfigPathTemplate.render({
1658
- project: project,
1659
- instance_config: instanceConfig,
1660
- });
1661
- }
1662
- /**
1663
- * Parse the project from InstanceConfig resource.
1664
- *
1665
- * @param {string} instanceConfigName
1666
- * A fully-qualified path representing InstanceConfig resource.
1667
- * @returns {string} A string representing the project.
1668
- */
1669
- matchProjectFromInstanceConfigName(instanceConfigName) {
1670
- return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).project;
1671
- }
1672
- /**
1673
- * Parse the instance_config from InstanceConfig resource.
1674
- *
1675
- * @param {string} instanceConfigName
1676
- * A fully-qualified path representing InstanceConfig resource.
1677
- * @returns {string} A string representing the instance_config.
1678
- */
1679
- matchInstanceConfigFromInstanceConfigName(instanceConfigName) {
1680
- return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config;
1681
- }
1682
- /**
1683
- * Return a fully-qualified instancePartition resource name string.
1684
- *
1685
- * @param {string} project
1686
- * @param {string} instance
1687
- * @param {string} instance_partition
1688
- * @returns {string} Resource name string.
1689
- */
1690
- instancePartitionPath(project, instance, instancePartition) {
1691
- return this.pathTemplates.instancePartitionPathTemplate.render({
1692
- project: project,
1693
- instance: instance,
1694
- instance_partition: instancePartition,
1695
- });
1696
- }
1697
- /**
1698
- * Parse the project from InstancePartition resource.
1699
- *
1700
- * @param {string} instancePartitionName
1701
- * A fully-qualified path representing InstancePartition resource.
1702
- * @returns {string} A string representing the project.
1703
- */
1704
- matchProjectFromInstancePartitionName(instancePartitionName) {
1705
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project;
1706
- }
1707
- /**
1708
- * Parse the instance from InstancePartition resource.
1709
- *
1710
- * @param {string} instancePartitionName
1711
- * A fully-qualified path representing InstancePartition resource.
1712
- * @returns {string} A string representing the instance.
1713
- */
1714
- matchInstanceFromInstancePartitionName(instancePartitionName) {
1715
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance;
1716
- }
1717
- /**
1718
- * Parse the instance_partition from InstancePartition resource.
1719
- *
1720
- * @param {string} instancePartitionName
1721
- * A fully-qualified path representing InstancePartition resource.
1722
- * @returns {string} A string representing the instance_partition.
1723
- */
1724
- matchInstancePartitionFromInstancePartitionName(instancePartitionName) {
1725
- return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition;
1726
- }
1727
- /**
1728
- * Return a fully-qualified project resource name string.
1729
- *
1730
- * @param {string} project
1731
- * @returns {string} Resource name string.
1732
- */
1733
- projectPath(project) {
1734
- return this.pathTemplates.projectPathTemplate.render({
1735
- project: project,
1736
- });
1737
- }
1738
- /**
1739
- * Parse the project from Project resource.
1740
- *
1741
- * @param {string} projectName
1742
- * A fully-qualified path representing Project resource.
1743
- * @returns {string} A string representing the project.
1744
- */
1745
- matchProjectFromProjectName(projectName) {
1746
- return this.pathTemplates.projectPathTemplate.match(projectName).project;
1747
- }
1748
- /**
1749
- * Terminate the gRPC channel and close the client.
1750
- *
1751
- * The client will no longer be usable and all future behavior is undefined.
1752
- * @returns {Promise} A promise that resolves when the client is closed.
1753
- */
1754
- close() {
1755
- if (this.instanceAdminStub && !this._terminated) {
1756
- return this.instanceAdminStub.then(stub => {
1757
- this._terminated = true;
1758
- stub.close();
1759
- this.operationsClient.close();
1760
- });
1761
- }
1762
- return Promise.resolve();
1763
- }
1764
- }
1765
- exports.InstanceAdminClient = InstanceAdminClient;
1766
- //# sourceMappingURL=instance_admin_client.js.map