@google-cloud/spanner 7.5.0 → 7.6.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.
@@ -167,6 +167,7 @@ class InstanceAdminClient {
167
167
  this.pathTemplates = {
168
168
  instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
169
169
  instanceConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instanceConfigs/{instance_config}'),
170
+ instancePartitionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/instancePartitions/{instance_partition}'),
170
171
  projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
171
172
  };
172
173
  // Some of the methods on this service return "paged" results,
@@ -176,6 +177,8 @@ class InstanceAdminClient {
176
177
  listInstanceConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instanceConfigs'),
177
178
  listInstanceConfigOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
178
179
  listInstances: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'),
180
+ listInstancePartitions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instancePartitions'),
181
+ listInstancePartitionOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
179
182
  };
180
183
  const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
181
184
  // This API contains "long-running operations", which return a
@@ -229,11 +232,17 @@ class InstanceAdminClient {
229
232
  const createInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceMetadata');
230
233
  const updateInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
231
234
  const updateInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstanceMetadata');
235
+ const createInstancePartitionResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstancePartition');
236
+ const createInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata');
237
+ const updateInstancePartitionResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstancePartition');
238
+ const updateInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata');
232
239
  this.descriptors.longrunning = {
233
240
  createInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)),
234
241
  updateInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)),
235
242
  createInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), createInstanceMetadata.decode.bind(createInstanceMetadata)),
236
243
  updateInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), updateInstanceMetadata.decode.bind(updateInstanceMetadata)),
244
+ createInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstancePartitionResponse.decode.bind(createInstancePartitionResponse), createInstancePartitionMetadata.decode.bind(createInstancePartitionMetadata)),
245
+ updateInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstancePartitionResponse.decode.bind(updateInstancePartitionResponse), updateInstancePartitionMetadata.decode.bind(updateInstancePartitionMetadata)),
237
246
  };
238
247
  // Put together the default options sent with requests.
239
248
  this._defaults = this._gaxGrpc.constructSettings('google.spanner.admin.instance.v1.InstanceAdmin', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -276,6 +285,7 @@ class InstanceAdminClient {
276
285
  'deleteInstanceConfig',
277
286
  'listInstanceConfigOperations',
278
287
  'listInstances',
288
+ 'listInstancePartitions',
279
289
  'getInstance',
280
290
  'createInstance',
281
291
  'updateInstance',
@@ -283,6 +293,11 @@ class InstanceAdminClient {
283
293
  'setIamPolicy',
284
294
  'getIamPolicy',
285
295
  'testIamPermissions',
296
+ 'getInstancePartition',
297
+ 'createInstancePartition',
298
+ 'deleteInstancePartition',
299
+ 'updateInstancePartition',
300
+ 'listInstancePartitionOperations',
286
301
  ];
287
302
  for (const methodName of instanceAdminStubMethods) {
288
303
  const callPromise = this.instanceAdminStub.then(stub => (...args) => {
@@ -512,6 +527,48 @@ class InstanceAdminClient {
512
527
  this.initialize();
513
528
  return this.innerApiCalls.testIamPermissions(request, options, callback);
514
529
  }
530
+ getInstancePartition(request, optionsOrCallback, callback) {
531
+ var _a;
532
+ request = request || {};
533
+ let options;
534
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
535
+ callback = optionsOrCallback;
536
+ options = {};
537
+ }
538
+ else {
539
+ options = optionsOrCallback;
540
+ }
541
+ options = options || {};
542
+ options.otherArgs = options.otherArgs || {};
543
+ options.otherArgs.headers = options.otherArgs.headers || {};
544
+ options.otherArgs.headers['x-goog-request-params'] =
545
+ this._gaxModule.routingHeader.fromParams({
546
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
547
+ });
548
+ this.initialize();
549
+ return this.innerApiCalls.getInstancePartition(request, options, callback);
550
+ }
551
+ deleteInstancePartition(request, optionsOrCallback, callback) {
552
+ var _a;
553
+ request = request || {};
554
+ let options;
555
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
556
+ callback = optionsOrCallback;
557
+ options = {};
558
+ }
559
+ else {
560
+ options = optionsOrCallback;
561
+ }
562
+ options = options || {};
563
+ options.otherArgs = options.otherArgs || {};
564
+ options.otherArgs.headers = options.otherArgs.headers || {};
565
+ options.otherArgs.headers['x-goog-request-params'] =
566
+ this._gaxModule.routingHeader.fromParams({
567
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
568
+ });
569
+ this.initialize();
570
+ return this.innerApiCalls.deleteInstancePartition(request, options, callback);
571
+ }
515
572
  createInstanceConfig(request, optionsOrCallback, callback) {
516
573
  var _a;
517
574
  request = request || {};
@@ -656,6 +713,78 @@ class InstanceAdminClient {
656
713
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
657
714
  return decodeOperation;
658
715
  }
716
+ createInstancePartition(request, optionsOrCallback, callback) {
717
+ var _a;
718
+ request = request || {};
719
+ let options;
720
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
721
+ callback = optionsOrCallback;
722
+ options = {};
723
+ }
724
+ else {
725
+ options = optionsOrCallback;
726
+ }
727
+ options = options || {};
728
+ options.otherArgs = options.otherArgs || {};
729
+ options.otherArgs.headers = options.otherArgs.headers || {};
730
+ options.otherArgs.headers['x-goog-request-params'] =
731
+ this._gaxModule.routingHeader.fromParams({
732
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
733
+ });
734
+ this.initialize();
735
+ return this.innerApiCalls.createInstancePartition(request, options, callback);
736
+ }
737
+ /**
738
+ * Check the status of the long running operation returned by `createInstancePartition()`.
739
+ * @param {String} name
740
+ * The operation name that will be passed.
741
+ * @returns {Promise} - The promise which resolves to an object.
742
+ * The decoded operation object has result and metadata field to get information from.
743
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
744
+ * for more details and examples.
745
+ */
746
+ async checkCreateInstancePartitionProgress(name) {
747
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
748
+ const [operation] = await this.operationsClient.getOperation(request);
749
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings());
750
+ return decodeOperation;
751
+ }
752
+ updateInstancePartition(request, optionsOrCallback, callback) {
753
+ var _a;
754
+ request = request || {};
755
+ let options;
756
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
757
+ callback = optionsOrCallback;
758
+ options = {};
759
+ }
760
+ else {
761
+ options = optionsOrCallback;
762
+ }
763
+ options = options || {};
764
+ options.otherArgs = options.otherArgs || {};
765
+ options.otherArgs.headers = options.otherArgs.headers || {};
766
+ options.otherArgs.headers['x-goog-request-params'] =
767
+ this._gaxModule.routingHeader.fromParams({
768
+ 'instance_partition.name': (_a = request.instancePartition.name) !== null && _a !== void 0 ? _a : '',
769
+ });
770
+ this.initialize();
771
+ return this.innerApiCalls.updateInstancePartition(request, options, callback);
772
+ }
773
+ /**
774
+ * Check the status of the long running operation returned by `updateInstancePartition()`.
775
+ * @param {String} name
776
+ * The operation name that will be passed.
777
+ * @returns {Promise} - The promise which resolves to an object.
778
+ * The decoded operation object has result and metadata field to get information from.
779
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
780
+ * for more details and examples.
781
+ */
782
+ async checkUpdateInstancePartitionProgress(name) {
783
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
784
+ const [operation] = await this.operationsClient.getOperation(request);
785
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings());
786
+ return decodeOperation;
787
+ }
659
788
  listInstanceConfigs(request, optionsOrCallback, callback) {
660
789
  var _a;
661
790
  request = request || {};
@@ -1012,6 +1141,13 @@ class InstanceAdminClient {
1012
1141
  * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1013
1142
  * it has the label "env" with its value
1014
1143
  * containing "dev".
1144
+ * @param {google.protobuf.Timestamp} request.instanceDeadline
1145
+ * Deadline used while retrieving metadata for instances.
1146
+ * Instances whose metadata cannot be retrieved within this deadline will be
1147
+ * added to
1148
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1149
+ * in
1150
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1015
1151
  * @param {object} [options]
1016
1152
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1017
1153
  * @returns {Stream}
@@ -1075,6 +1211,13 @@ class InstanceAdminClient {
1075
1211
  * * `name:howl labels.env:dev` --> The instance's name contains "howl" and
1076
1212
  * it has the label "env" with its value
1077
1213
  * containing "dev".
1214
+ * @param {google.protobuf.Timestamp} request.instanceDeadline
1215
+ * Deadline used while retrieving metadata for instances.
1216
+ * Instances whose metadata cannot be retrieved within this deadline will be
1217
+ * added to
1218
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse.unreachable|unreachable}
1219
+ * in
1220
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
1078
1221
  * @param {object} [options]
1079
1222
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1080
1223
  * @returns {Object}
@@ -1100,6 +1243,330 @@ class InstanceAdminClient {
1100
1243
  this.initialize();
1101
1244
  return this.descriptors.page.listInstances.asyncIterate(this.innerApiCalls['listInstances'], request, callSettings);
1102
1245
  }
1246
+ listInstancePartitions(request, optionsOrCallback, callback) {
1247
+ var _a;
1248
+ request = request || {};
1249
+ let options;
1250
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1251
+ callback = optionsOrCallback;
1252
+ options = {};
1253
+ }
1254
+ else {
1255
+ options = optionsOrCallback;
1256
+ }
1257
+ options = options || {};
1258
+ options.otherArgs = options.otherArgs || {};
1259
+ options.otherArgs.headers = options.otherArgs.headers || {};
1260
+ options.otherArgs.headers['x-goog-request-params'] =
1261
+ this._gaxModule.routingHeader.fromParams({
1262
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1263
+ });
1264
+ this.initialize();
1265
+ return this.innerApiCalls.listInstancePartitions(request, options, callback);
1266
+ }
1267
+ /**
1268
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1269
+ * @param {Object} request
1270
+ * The request object that will be sent.
1271
+ * @param {string} request.parent
1272
+ * Required. The instance whose instance partitions should be listed. Values
1273
+ * are of the form `projects/<project>/instances/<instance>`.
1274
+ * @param {number} request.pageSize
1275
+ * Number of instance partitions to be returned in the response. If 0 or less,
1276
+ * defaults to the server's maximum allowed page size.
1277
+ * @param {string} request.pageToken
1278
+ * If non-empty, `page_token` should contain a
1279
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token}
1280
+ * from a previous
1281
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1282
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1283
+ * Optional. Deadline used while retrieving metadata for instance partitions.
1284
+ * Instance partitions whose metadata cannot be retrieved within this deadline
1285
+ * will be added to
1286
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable}
1287
+ * in
1288
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1289
+ * @param {object} [options]
1290
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1291
+ * @returns {Stream}
1292
+ * An object stream which emits an object representing {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition} on 'data' event.
1293
+ * The client library will perform auto-pagination by default: it will call the API as many
1294
+ * times as needed. Note that it can affect your quota.
1295
+ * We recommend using `listInstancePartitionsAsync()`
1296
+ * method described below for async iteration which you can stop as needed.
1297
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1298
+ * for more details and examples.
1299
+ */
1300
+ listInstancePartitionsStream(request, options) {
1301
+ var _a;
1302
+ request = request || {};
1303
+ options = options || {};
1304
+ options.otherArgs = options.otherArgs || {};
1305
+ options.otherArgs.headers = options.otherArgs.headers || {};
1306
+ options.otherArgs.headers['x-goog-request-params'] =
1307
+ this._gaxModule.routingHeader.fromParams({
1308
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1309
+ });
1310
+ const defaultCallSettings = this._defaults['listInstancePartitions'];
1311
+ const callSettings = defaultCallSettings.merge(options);
1312
+ this.initialize();
1313
+ return this.descriptors.page.listInstancePartitions.createStream(this.innerApiCalls.listInstancePartitions, request, callSettings);
1314
+ }
1315
+ /**
1316
+ * Equivalent to `listInstancePartitions`, but returns an iterable object.
1317
+ *
1318
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1319
+ * @param {Object} request
1320
+ * The request object that will be sent.
1321
+ * @param {string} request.parent
1322
+ * Required. The instance whose instance partitions should be listed. Values
1323
+ * are of the form `projects/<project>/instances/<instance>`.
1324
+ * @param {number} request.pageSize
1325
+ * Number of instance partitions to be returned in the response. If 0 or less,
1326
+ * defaults to the server's maximum allowed page size.
1327
+ * @param {string} request.pageToken
1328
+ * If non-empty, `page_token` should contain a
1329
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token|next_page_token}
1330
+ * from a previous
1331
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1332
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1333
+ * Optional. Deadline used while retrieving metadata for instance partitions.
1334
+ * Instance partitions whose metadata cannot be retrieved within this deadline
1335
+ * will be added to
1336
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable|unreachable}
1337
+ * in
1338
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionsResponse|ListInstancePartitionsResponse}.
1339
+ * @param {object} [options]
1340
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1341
+ * @returns {Object}
1342
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1343
+ * When you iterate the returned iterable, each element will be an object representing
1344
+ * {@link protos.google.spanner.admin.instance.v1.InstancePartition|InstancePartition}. The API will be called under the hood as needed, once per the page,
1345
+ * so you can stop the iteration when you don't need more results.
1346
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1347
+ * for more details and examples.
1348
+ */
1349
+ listInstancePartitionsAsync(request, options) {
1350
+ var _a;
1351
+ request = request || {};
1352
+ options = options || {};
1353
+ options.otherArgs = options.otherArgs || {};
1354
+ options.otherArgs.headers = options.otherArgs.headers || {};
1355
+ options.otherArgs.headers['x-goog-request-params'] =
1356
+ this._gaxModule.routingHeader.fromParams({
1357
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1358
+ });
1359
+ const defaultCallSettings = this._defaults['listInstancePartitions'];
1360
+ const callSettings = defaultCallSettings.merge(options);
1361
+ this.initialize();
1362
+ return this.descriptors.page.listInstancePartitions.asyncIterate(this.innerApiCalls['listInstancePartitions'], request, callSettings);
1363
+ }
1364
+ listInstancePartitionOperations(request, optionsOrCallback, callback) {
1365
+ var _a;
1366
+ request = request || {};
1367
+ let options;
1368
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1369
+ callback = optionsOrCallback;
1370
+ options = {};
1371
+ }
1372
+ else {
1373
+ options = optionsOrCallback;
1374
+ }
1375
+ options = options || {};
1376
+ options.otherArgs = options.otherArgs || {};
1377
+ options.otherArgs.headers = options.otherArgs.headers || {};
1378
+ options.otherArgs.headers['x-goog-request-params'] =
1379
+ this._gaxModule.routingHeader.fromParams({
1380
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1381
+ });
1382
+ this.initialize();
1383
+ return this.innerApiCalls.listInstancePartitionOperations(request, options, callback);
1384
+ }
1385
+ /**
1386
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1387
+ * @param {Object} request
1388
+ * The request object that will be sent.
1389
+ * @param {string} request.parent
1390
+ * Required. The parent instance of the instance partition operations.
1391
+ * Values are of the form `projects/<project>/instances/<instance>`.
1392
+ * @param {string} [request.filter]
1393
+ * Optional. An expression that filters the list of returned operations.
1394
+ *
1395
+ * A filter expression consists of a field name, a
1396
+ * comparison operator, and a value for filtering.
1397
+ * The value must be a string, a number, or a boolean. The comparison operator
1398
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1399
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1400
+ *
1401
+ * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1402
+ * are eligible for filtering:
1403
+ *
1404
+ * * `name` - The name of the long-running operation
1405
+ * * `done` - False if the operation is in progress, else true.
1406
+ * * `metadata.@type` - the type of metadata. For example, the type string
1407
+ * for
1408
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1409
+ * is
1410
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1411
+ * * `metadata.<field_name>` - any field in metadata.value.
1412
+ * `metadata.@type` must be specified first, if filtering on metadata
1413
+ * fields.
1414
+ * * `error` - Error associated with the long-running operation.
1415
+ * * `response.@type` - the type of response.
1416
+ * * `response.<field_name>` - any field in response.value.
1417
+ *
1418
+ * You can combine multiple expressions by enclosing each expression in
1419
+ * parentheses. By default, expressions are combined with AND logic. However,
1420
+ * you can specify AND, OR, and NOT logic explicitly.
1421
+ *
1422
+ * Here are a few examples:
1423
+ *
1424
+ * * `done:true` - The operation is complete.
1425
+ * * `(metadata.@type=` \
1426
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1427
+ * AND` \
1428
+ * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1429
+ * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1430
+ * `(error:*)` - Return operations where:
1431
+ * * The operation's metadata type is
1432
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1433
+ * * The instance partition name contains "custom-instance-partition".
1434
+ * * The operation started before 2021-03-28T14:50:00Z.
1435
+ * * The operation resulted in an error.
1436
+ * @param {number} [request.pageSize]
1437
+ * Optional. Number of operations to be returned in the response. If 0 or
1438
+ * less, defaults to the server's maximum allowed page size.
1439
+ * @param {string} [request.pageToken]
1440
+ * Optional. If non-empty, `page_token` should contain a
1441
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1442
+ * from a previous
1443
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1444
+ * to the same `parent` and with the same `filter`.
1445
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1446
+ * Optional. Deadline used while retrieving metadata for instance partition
1447
+ * operations. Instance partitions whose operation metadata cannot be
1448
+ * retrieved within this deadline will be added to
1449
+ * {@link protos.ListInstancePartitionOperationsResponse.unreachable|unreachable} in
1450
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1451
+ * @param {object} [options]
1452
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1453
+ * @returns {Stream}
1454
+ * An object stream which emits an object representing {@link protos.google.longrunning.Operation|Operation} on 'data' event.
1455
+ * The client library will perform auto-pagination by default: it will call the API as many
1456
+ * times as needed. Note that it can affect your quota.
1457
+ * We recommend using `listInstancePartitionOperationsAsync()`
1458
+ * method described below for async iteration which you can stop as needed.
1459
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1460
+ * for more details and examples.
1461
+ */
1462
+ listInstancePartitionOperationsStream(request, options) {
1463
+ var _a;
1464
+ request = request || {};
1465
+ options = options || {};
1466
+ options.otherArgs = options.otherArgs || {};
1467
+ options.otherArgs.headers = options.otherArgs.headers || {};
1468
+ options.otherArgs.headers['x-goog-request-params'] =
1469
+ this._gaxModule.routingHeader.fromParams({
1470
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1471
+ });
1472
+ const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1473
+ const callSettings = defaultCallSettings.merge(options);
1474
+ this.initialize();
1475
+ return this.descriptors.page.listInstancePartitionOperations.createStream(this.innerApiCalls.listInstancePartitionOperations, request, callSettings);
1476
+ }
1477
+ /**
1478
+ * Equivalent to `listInstancePartitionOperations`, but returns an iterable object.
1479
+ *
1480
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1481
+ * @param {Object} request
1482
+ * The request object that will be sent.
1483
+ * @param {string} request.parent
1484
+ * Required. The parent instance of the instance partition operations.
1485
+ * Values are of the form `projects/<project>/instances/<instance>`.
1486
+ * @param {string} [request.filter]
1487
+ * Optional. An expression that filters the list of returned operations.
1488
+ *
1489
+ * A filter expression consists of a field name, a
1490
+ * comparison operator, and a value for filtering.
1491
+ * The value must be a string, a number, or a boolean. The comparison operator
1492
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1493
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1494
+ *
1495
+ * The following fields in the {@link protos.google.longrunning.Operation|Operation}
1496
+ * are eligible for filtering:
1497
+ *
1498
+ * * `name` - The name of the long-running operation
1499
+ * * `done` - False if the operation is in progress, else true.
1500
+ * * `metadata.@type` - the type of metadata. For example, the type string
1501
+ * for
1502
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}
1503
+ * is
1504
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1505
+ * * `metadata.<field_name>` - any field in metadata.value.
1506
+ * `metadata.@type` must be specified first, if filtering on metadata
1507
+ * fields.
1508
+ * * `error` - Error associated with the long-running operation.
1509
+ * * `response.@type` - the type of response.
1510
+ * * `response.<field_name>` - any field in response.value.
1511
+ *
1512
+ * You can combine multiple expressions by enclosing each expression in
1513
+ * parentheses. By default, expressions are combined with AND logic. However,
1514
+ * you can specify AND, OR, and NOT logic explicitly.
1515
+ *
1516
+ * Here are a few examples:
1517
+ *
1518
+ * * `done:true` - The operation is complete.
1519
+ * * `(metadata.@type=` \
1520
+ * `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1521
+ * AND` \
1522
+ * `(metadata.instance_partition.name:custom-instance-partition) AND` \
1523
+ * `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1524
+ * `(error:*)` - Return operations where:
1525
+ * * The operation's metadata type is
1526
+ * {@link protos.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata|CreateInstancePartitionMetadata}.
1527
+ * * The instance partition name contains "custom-instance-partition".
1528
+ * * The operation started before 2021-03-28T14:50:00Z.
1529
+ * * The operation resulted in an error.
1530
+ * @param {number} [request.pageSize]
1531
+ * Optional. Number of operations to be returned in the response. If 0 or
1532
+ * less, defaults to the server's maximum allowed page size.
1533
+ * @param {string} [request.pageToken]
1534
+ * Optional. If non-empty, `page_token` should contain a
1535
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token|next_page_token}
1536
+ * from a previous
1537
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}
1538
+ * to the same `parent` and with the same `filter`.
1539
+ * @param {google.protobuf.Timestamp} [request.instancePartitionDeadline]
1540
+ * Optional. Deadline used while retrieving metadata for instance partition
1541
+ * operations. Instance partitions whose operation metadata cannot be
1542
+ * retrieved within this deadline will be added to
1543
+ * {@link protos.ListInstancePartitionOperationsResponse.unreachable|unreachable} in
1544
+ * {@link protos.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse|ListInstancePartitionOperationsResponse}.
1545
+ * @param {object} [options]
1546
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1547
+ * @returns {Object}
1548
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1549
+ * When you iterate the returned iterable, each element will be an object representing
1550
+ * {@link protos.google.longrunning.Operation|Operation}. The API will be called under the hood as needed, once per the page,
1551
+ * so you can stop the iteration when you don't need more results.
1552
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1553
+ * for more details and examples.
1554
+ */
1555
+ listInstancePartitionOperationsAsync(request, options) {
1556
+ var _a;
1557
+ request = request || {};
1558
+ options = options || {};
1559
+ options.otherArgs = options.otherArgs || {};
1560
+ options.otherArgs.headers = options.otherArgs.headers || {};
1561
+ options.otherArgs.headers['x-goog-request-params'] =
1562
+ this._gaxModule.routingHeader.fromParams({
1563
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1564
+ });
1565
+ const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1566
+ const callSettings = defaultCallSettings.merge(options);
1567
+ this.initialize();
1568
+ return this.descriptors.page.listInstancePartitionOperations.asyncIterate(this.innerApiCalls['listInstancePartitionOperations'], request, callSettings);
1569
+ }
1103
1570
  // --------------------
1104
1571
  // -- Path templates --
1105
1572
  // --------------------
@@ -1169,6 +1636,51 @@ class InstanceAdminClient {
1169
1636
  matchInstanceConfigFromInstanceConfigName(instanceConfigName) {
1170
1637
  return this.pathTemplates.instanceConfigPathTemplate.match(instanceConfigName).instance_config;
1171
1638
  }
1639
+ /**
1640
+ * Return a fully-qualified instancePartition resource name string.
1641
+ *
1642
+ * @param {string} project
1643
+ * @param {string} instance
1644
+ * @param {string} instance_partition
1645
+ * @returns {string} Resource name string.
1646
+ */
1647
+ instancePartitionPath(project, instance, instancePartition) {
1648
+ return this.pathTemplates.instancePartitionPathTemplate.render({
1649
+ project: project,
1650
+ instance: instance,
1651
+ instance_partition: instancePartition,
1652
+ });
1653
+ }
1654
+ /**
1655
+ * Parse the project from InstancePartition resource.
1656
+ *
1657
+ * @param {string} instancePartitionName
1658
+ * A fully-qualified path representing InstancePartition resource.
1659
+ * @returns {string} A string representing the project.
1660
+ */
1661
+ matchProjectFromInstancePartitionName(instancePartitionName) {
1662
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).project;
1663
+ }
1664
+ /**
1665
+ * Parse the instance from InstancePartition resource.
1666
+ *
1667
+ * @param {string} instancePartitionName
1668
+ * A fully-qualified path representing InstancePartition resource.
1669
+ * @returns {string} A string representing the instance.
1670
+ */
1671
+ matchInstanceFromInstancePartitionName(instancePartitionName) {
1672
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance;
1673
+ }
1674
+ /**
1675
+ * Parse the instance_partition from InstancePartition resource.
1676
+ *
1677
+ * @param {string} instancePartitionName
1678
+ * A fully-qualified path representing InstancePartition resource.
1679
+ * @returns {string} A string representing the instance_partition.
1680
+ */
1681
+ matchInstancePartitionFromInstancePartitionName(instancePartitionName) {
1682
+ return this.pathTemplates.instancePartitionPathTemplate.match(instancePartitionName).instance_partition;
1683
+ }
1172
1684
  /**
1173
1685
  * Return a fully-qualified project resource name string.
1174
1686
  *
@@ -60,6 +60,10 @@
60
60
  "retry_codes_name": "idempotent",
61
61
  "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
62
62
  },
63
+ "ListInstancePartitions": {
64
+ "retry_codes_name": "non_idempotent",
65
+ "retry_params_name": "default"
66
+ },
63
67
  "GetInstance": {
64
68
  "timeout_millis": 3600000,
65
69
  "retry_codes_name": "idempotent",
@@ -94,6 +98,26 @@
94
98
  "timeout_millis": 30000,
95
99
  "retry_codes_name": "non_idempotent",
96
100
  "retry_params_name": "default"
101
+ },
102
+ "GetInstancePartition": {
103
+ "retry_codes_name": "non_idempotent",
104
+ "retry_params_name": "default"
105
+ },
106
+ "CreateInstancePartition": {
107
+ "retry_codes_name": "non_idempotent",
108
+ "retry_params_name": "default"
109
+ },
110
+ "DeleteInstancePartition": {
111
+ "retry_codes_name": "non_idempotent",
112
+ "retry_params_name": "default"
113
+ },
114
+ "UpdateInstancePartition": {
115
+ "retry_codes_name": "non_idempotent",
116
+ "retry_params_name": "default"
117
+ },
118
+ "ListInstancePartitionOperations": {
119
+ "retry_codes_name": "non_idempotent",
120
+ "retry_params_name": "default"
97
121
  }
98
122
  }
99
123
  }