@google-cloud/spanner 7.21.0 → 8.1.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 (76) hide show
  1. package/README.md +2 -0
  2. package/build/protos/google/spanner/admin/database/v1/backup.proto +1 -1
  3. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +1 -1
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +1 -1
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +36 -1
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +1 -1
  7. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +1 -1
  8. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1 -1
  9. package/build/protos/google/spanner/v1/change_stream.proto +451 -0
  10. package/build/protos/google/spanner/v1/commit_response.proto +10 -5
  11. package/build/protos/google/spanner/v1/keys.proto +1 -1
  12. package/build/protos/google/spanner/v1/mutation.proto +1 -1
  13. package/build/protos/google/spanner/v1/query_plan.proto +1 -1
  14. package/build/protos/google/spanner/v1/result_set.proto +55 -49
  15. package/build/protos/google/spanner/v1/spanner.proto +1 -1
  16. package/build/protos/google/spanner/v1/transaction.proto +41 -357
  17. package/build/protos/google/spanner/v1/type.proto +1 -1
  18. package/build/protos/protos.d.ts +1577 -194
  19. package/build/protos/protos.js +3977 -288
  20. package/build/protos/protos.json +325 -3
  21. package/build/src/backup.js +7 -0
  22. package/build/src/batch-transaction.d.ts +48 -29
  23. package/build/src/batch-transaction.js +15 -100
  24. package/build/src/codec.js +63 -47
  25. package/build/src/common-grpc/service-object.js +1 -0
  26. package/build/src/common-grpc/service.js +35 -18
  27. package/build/src/common.d.ts +1 -0
  28. package/build/src/common.js +9 -1
  29. package/build/src/database.d.ts +1 -0
  30. package/build/src/database.js +54 -42
  31. package/build/src/helper.d.ts +99 -0
  32. package/build/src/helper.js +178 -0
  33. package/build/src/index.d.ts +33 -0
  34. package/build/src/index.js +202 -21
  35. package/build/src/instance-config.d.ts +1 -1
  36. package/build/src/instance-config.js +4 -0
  37. package/build/src/instance.js +12 -6
  38. package/build/src/instrument.js +5 -6
  39. package/build/src/metrics/constants.d.ts +36 -0
  40. package/build/src/metrics/constants.js +106 -0
  41. package/build/src/metrics/external-types.d.ts +20 -0
  42. package/build/src/metrics/external-types.js +32 -0
  43. package/build/src/metrics/interceptor.d.ts +13 -0
  44. package/build/src/metrics/interceptor.js +87 -0
  45. package/build/src/metrics/metrics-tracer-factory.d.ts +165 -0
  46. package/build/src/metrics/metrics-tracer-factory.js +389 -0
  47. package/build/src/metrics/metrics-tracer.d.ts +204 -0
  48. package/build/src/metrics/metrics-tracer.js +371 -0
  49. package/build/src/metrics/spanner-metrics-exporter.d.ts +35 -0
  50. package/build/src/metrics/spanner-metrics-exporter.js +119 -0
  51. package/build/src/metrics/transform.d.ts +144 -0
  52. package/build/src/metrics/transform.js +272 -0
  53. package/build/src/multiplexed-session.js +7 -1
  54. package/build/src/partial-result-stream.js +18 -10
  55. package/build/src/request_id_header.js +1 -0
  56. package/build/src/session-factory.d.ts +34 -0
  57. package/build/src/session-factory.js +35 -2
  58. package/build/src/session-pool.js +24 -8
  59. package/build/src/session.d.ts +0 -1
  60. package/build/src/session.js +7 -2
  61. package/build/src/table.js +6 -3
  62. package/build/src/transaction-runner.d.ts +1 -0
  63. package/build/src/transaction-runner.js +18 -2
  64. package/build/src/transaction.d.ts +42 -1
  65. package/build/src/transaction.js +258 -94
  66. package/build/src/v1/database_admin_client.d.ts +37 -2
  67. package/build/src/v1/database_admin_client.js +718 -168
  68. package/build/src/v1/database_admin_client_config.json +4 -0
  69. package/build/src/v1/instance_admin_client.d.ts +122 -1
  70. package/build/src/v1/instance_admin_client.js +765 -146
  71. package/build/src/v1/spanner_client.d.ts +2 -1
  72. package/build/src/v1/spanner_client.js +391 -85
  73. package/build/src/v1/spanner_executor_proxy_client.d.ts +2 -1
  74. package/build/src/v1/spanner_executor_proxy_client.js +41 -19
  75. package/build/src/v1/spanner_proto_list.json +1 -0
  76. package/package.json +64 -58
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.InstanceAdminClient = void 0;
21
21
  const jsonProtos = require("../../protos/protos.json");
22
+ const google_gax_1 = require("google-gax");
22
23
  /**
23
24
  * Client JSON configuration object, loaded from
24
25
  * `src/v1/instance_admin_client_config.json`.
@@ -52,6 +53,28 @@ const version = require('../../../package.json').version;
52
53
  * @memberof v1
53
54
  */
54
55
  class InstanceAdminClient {
56
+ _terminated = false;
57
+ _opts;
58
+ _providedCustomServicePath;
59
+ _gaxModule;
60
+ _gaxGrpc;
61
+ _protos;
62
+ _defaults;
63
+ _universeDomain;
64
+ _servicePath;
65
+ _log = google_gax_1.loggingUtils.log('spanner');
66
+ auth;
67
+ descriptors = {
68
+ page: {},
69
+ stream: {},
70
+ longrunning: {},
71
+ batching: {},
72
+ };
73
+ warn;
74
+ innerApiCalls;
75
+ pathTemplates;
76
+ operationsClient;
77
+ instanceAdminStub;
55
78
  /**
56
79
  * Construct an instance of InstanceAdminClient.
57
80
  *
@@ -74,7 +97,7 @@ class InstanceAdminClient {
74
97
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
75
98
  * the environment variable GCLOUD_PROJECT for your project ID. If your
76
99
  * app is running in an environment which supports
77
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
100
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
78
101
  * your project ID will be detected automatically.
79
102
  * @param {string} [options.apiEndpoint] - The domain name of the
80
103
  * API remote host.
@@ -92,32 +115,28 @@ class InstanceAdminClient {
92
115
  * ```
93
116
  */
94
117
  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
118
  // Ensure that options include all the required fields.
104
119
  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)) {
120
+ if (opts?.universe_domain &&
121
+ opts?.universeDomain &&
122
+ opts?.universe_domain !== opts?.universeDomain) {
108
123
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
109
124
  }
110
125
  const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
111
126
  ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
112
127
  : undefined;
113
128
  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';
129
+ opts?.universeDomain ??
130
+ opts?.universe_domain ??
131
+ universeDomainEnvVar ??
132
+ 'googleapis.com';
115
133
  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');
134
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
135
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
136
+ const port = opts?.port || staticMembers.port;
137
+ const clientConfig = opts?.clientConfig ?? {};
138
+ const fallback = opts?.fallback ??
139
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
140
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
141
  // Request numeric enum values if REST transport is used.
123
142
  opts.numericEnums = true;
@@ -183,7 +202,7 @@ class InstanceAdminClient {
183
202
  listInstancePartitions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instancePartitions'),
184
203
  listInstancePartitionOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
185
204
  };
186
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
205
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
187
206
  // This API contains "long-running operations", which return a
188
207
  // an Operation object that allows for tracking of the operation,
189
208
  // rather than holding a request open.
@@ -195,31 +214,69 @@ class InstanceAdminClient {
195
214
  lroOptions.protoJson = protoFilesRoot;
196
215
  lroOptions.httpRules = [
197
216
  {
198
- selector: 'google.longrunning.Operations.GetOperation',
199
- get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
217
+ selector: 'google.longrunning.Operations.CancelOperation',
218
+ post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
200
219
  additional_bindings: [
201
- { get: '/v1/{name=projects/*/instances/*/operations/*}' },
220
+ { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
221
+ {
222
+ post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',
223
+ },
224
+ {
225
+ post: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel',
226
+ },
227
+ {
228
+ post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',
229
+ },
230
+ {
231
+ post: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel',
232
+ },
202
233
  ],
203
234
  },
204
235
  {
205
- selector: 'google.longrunning.Operations.ListOperations',
206
- get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
236
+ selector: 'google.longrunning.Operations.DeleteOperation',
237
+ delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
207
238
  additional_bindings: [
208
- { get: '/v1/{name=projects/*/instances/*/operations}' },
239
+ { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
240
+ {
241
+ delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',
242
+ },
243
+ {
244
+ delete: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',
245
+ },
246
+ { delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
247
+ {
248
+ delete: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',
249
+ },
209
250
  ],
210
251
  },
211
252
  {
212
- selector: 'google.longrunning.Operations.CancelOperation',
213
- post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
253
+ selector: 'google.longrunning.Operations.GetOperation',
254
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
214
255
  additional_bindings: [
215
- { post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
256
+ { get: '/v1/{name=projects/*/instances/*/operations/*}' },
257
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}' },
258
+ {
259
+ get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}',
260
+ },
261
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
262
+ {
263
+ get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}',
264
+ },
216
265
  ],
217
266
  },
218
267
  {
219
- selector: 'google.longrunning.Operations.DeleteOperation',
220
- delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
268
+ selector: 'google.longrunning.Operations.ListOperations',
269
+ get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
221
270
  additional_bindings: [
222
- { delete: '/v1/{name=projects/*/instances/*/operations/*}' },
271
+ { get: '/v1/{name=projects/*/instances/*/operations}' },
272
+ { get: '/v1/{name=projects/*/instances/*/backups/*/operations}' },
273
+ {
274
+ get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations}',
275
+ },
276
+ { get: '/v1/{name=projects/*/instanceConfigs/*/operations}' },
277
+ {
278
+ get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}',
279
+ },
223
280
  ],
224
281
  },
225
282
  ];
@@ -388,7 +445,6 @@ class InstanceAdminClient {
388
445
  return this.auth.getProjectId();
389
446
  }
390
447
  getInstanceConfig(request, optionsOrCallback, callback) {
391
- var _a;
392
448
  request = request || {};
393
449
  let options;
394
450
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -403,13 +459,35 @@ class InstanceAdminClient {
403
459
  options.otherArgs.headers = options.otherArgs.headers || {};
404
460
  options.otherArgs.headers['x-goog-request-params'] =
405
461
  this._gaxModule.routingHeader.fromParams({
406
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
462
+ name: request.name ?? '',
407
463
  });
408
- this.initialize();
409
- return this.innerApiCalls.getInstanceConfig(request, options, callback);
464
+ this.initialize().catch(err => {
465
+ throw err;
466
+ });
467
+ this._log.info('getInstanceConfig request %j', request);
468
+ const wrappedCallback = callback
469
+ ? (error, response, options, rawResponse) => {
470
+ this._log.info('getInstanceConfig response %j', response);
471
+ callback(error, response, options, rawResponse); // We verified callback above.
472
+ }
473
+ : undefined;
474
+ return this.innerApiCalls
475
+ .getInstanceConfig(request, options, wrappedCallback)
476
+ ?.then(([response, options, rawResponse]) => {
477
+ this._log.info('getInstanceConfig response %j', response);
478
+ return [response, options, rawResponse];
479
+ })
480
+ .catch((error) => {
481
+ if (error &&
482
+ 'statusDetails' in error &&
483
+ error.statusDetails instanceof Array) {
484
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
485
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
486
+ }
487
+ throw error;
488
+ });
410
489
  }
411
490
  deleteInstanceConfig(request, optionsOrCallback, callback) {
412
- var _a;
413
491
  request = request || {};
414
492
  let options;
415
493
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -424,13 +502,35 @@ class InstanceAdminClient {
424
502
  options.otherArgs.headers = options.otherArgs.headers || {};
425
503
  options.otherArgs.headers['x-goog-request-params'] =
426
504
  this._gaxModule.routingHeader.fromParams({
427
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
505
+ name: request.name ?? '',
428
506
  });
429
- this.initialize();
430
- return this.innerApiCalls.deleteInstanceConfig(request, options, callback);
507
+ this.initialize().catch(err => {
508
+ throw err;
509
+ });
510
+ this._log.info('deleteInstanceConfig request %j', request);
511
+ const wrappedCallback = callback
512
+ ? (error, response, options, rawResponse) => {
513
+ this._log.info('deleteInstanceConfig response %j', response);
514
+ callback(error, response, options, rawResponse); // We verified callback above.
515
+ }
516
+ : undefined;
517
+ return this.innerApiCalls
518
+ .deleteInstanceConfig(request, options, wrappedCallback)
519
+ ?.then(([response, options, rawResponse]) => {
520
+ this._log.info('deleteInstanceConfig response %j', response);
521
+ return [response, options, rawResponse];
522
+ })
523
+ .catch((error) => {
524
+ if (error &&
525
+ 'statusDetails' in error &&
526
+ error.statusDetails instanceof Array) {
527
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
528
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
529
+ }
530
+ throw error;
531
+ });
431
532
  }
432
533
  getInstance(request, optionsOrCallback, callback) {
433
- var _a;
434
534
  request = request || {};
435
535
  let options;
436
536
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -445,13 +545,35 @@ class InstanceAdminClient {
445
545
  options.otherArgs.headers = options.otherArgs.headers || {};
446
546
  options.otherArgs.headers['x-goog-request-params'] =
447
547
  this._gaxModule.routingHeader.fromParams({
448
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
548
+ name: request.name ?? '',
449
549
  });
450
- this.initialize();
451
- return this.innerApiCalls.getInstance(request, options, callback);
550
+ this.initialize().catch(err => {
551
+ throw err;
552
+ });
553
+ this._log.info('getInstance request %j', request);
554
+ const wrappedCallback = callback
555
+ ? (error, response, options, rawResponse) => {
556
+ this._log.info('getInstance response %j', response);
557
+ callback(error, response, options, rawResponse); // We verified callback above.
558
+ }
559
+ : undefined;
560
+ return this.innerApiCalls
561
+ .getInstance(request, options, wrappedCallback)
562
+ ?.then(([response, options, rawResponse]) => {
563
+ this._log.info('getInstance response %j', response);
564
+ return [response, options, rawResponse];
565
+ })
566
+ .catch((error) => {
567
+ if (error &&
568
+ 'statusDetails' in error &&
569
+ error.statusDetails instanceof Array) {
570
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
571
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
572
+ }
573
+ throw error;
574
+ });
452
575
  }
453
576
  deleteInstance(request, optionsOrCallback, callback) {
454
- var _a;
455
577
  request = request || {};
456
578
  let options;
457
579
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -466,13 +588,35 @@ class InstanceAdminClient {
466
588
  options.otherArgs.headers = options.otherArgs.headers || {};
467
589
  options.otherArgs.headers['x-goog-request-params'] =
468
590
  this._gaxModule.routingHeader.fromParams({
469
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
591
+ name: request.name ?? '',
470
592
  });
471
- this.initialize();
472
- return this.innerApiCalls.deleteInstance(request, options, callback);
593
+ this.initialize().catch(err => {
594
+ throw err;
595
+ });
596
+ this._log.info('deleteInstance request %j', request);
597
+ const wrappedCallback = callback
598
+ ? (error, response, options, rawResponse) => {
599
+ this._log.info('deleteInstance response %j', response);
600
+ callback(error, response, options, rawResponse); // We verified callback above.
601
+ }
602
+ : undefined;
603
+ return this.innerApiCalls
604
+ .deleteInstance(request, options, wrappedCallback)
605
+ ?.then(([response, options, rawResponse]) => {
606
+ this._log.info('deleteInstance response %j', response);
607
+ return [response, options, rawResponse];
608
+ })
609
+ .catch((error) => {
610
+ if (error &&
611
+ 'statusDetails' in error &&
612
+ error.statusDetails instanceof Array) {
613
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
614
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
615
+ }
616
+ throw error;
617
+ });
473
618
  }
474
619
  setIamPolicy(request, optionsOrCallback, callback) {
475
- var _a;
476
620
  request = request || {};
477
621
  let options;
478
622
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -487,13 +631,35 @@ class InstanceAdminClient {
487
631
  options.otherArgs.headers = options.otherArgs.headers || {};
488
632
  options.otherArgs.headers['x-goog-request-params'] =
489
633
  this._gaxModule.routingHeader.fromParams({
490
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
634
+ resource: request.resource ?? '',
491
635
  });
492
- this.initialize();
493
- return this.innerApiCalls.setIamPolicy(request, options, callback);
636
+ this.initialize().catch(err => {
637
+ throw err;
638
+ });
639
+ this._log.info('setIamPolicy request %j', request);
640
+ const wrappedCallback = callback
641
+ ? (error, response, options, rawResponse) => {
642
+ this._log.info('setIamPolicy response %j', response);
643
+ callback(error, response, options, rawResponse); // We verified callback above.
644
+ }
645
+ : undefined;
646
+ return this.innerApiCalls
647
+ .setIamPolicy(request, options, wrappedCallback)
648
+ ?.then(([response, options, rawResponse]) => {
649
+ this._log.info('setIamPolicy response %j', response);
650
+ return [response, options, rawResponse];
651
+ })
652
+ .catch((error) => {
653
+ if (error &&
654
+ 'statusDetails' in error &&
655
+ error.statusDetails instanceof Array) {
656
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
657
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
658
+ }
659
+ throw error;
660
+ });
494
661
  }
495
662
  getIamPolicy(request, optionsOrCallback, callback) {
496
- var _a;
497
663
  request = request || {};
498
664
  let options;
499
665
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -508,13 +674,35 @@ class InstanceAdminClient {
508
674
  options.otherArgs.headers = options.otherArgs.headers || {};
509
675
  options.otherArgs.headers['x-goog-request-params'] =
510
676
  this._gaxModule.routingHeader.fromParams({
511
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
677
+ resource: request.resource ?? '',
512
678
  });
513
- this.initialize();
514
- return this.innerApiCalls.getIamPolicy(request, options, callback);
679
+ this.initialize().catch(err => {
680
+ throw err;
681
+ });
682
+ this._log.info('getIamPolicy request %j', request);
683
+ const wrappedCallback = callback
684
+ ? (error, response, options, rawResponse) => {
685
+ this._log.info('getIamPolicy response %j', response);
686
+ callback(error, response, options, rawResponse); // We verified callback above.
687
+ }
688
+ : undefined;
689
+ return this.innerApiCalls
690
+ .getIamPolicy(request, options, wrappedCallback)
691
+ ?.then(([response, options, rawResponse]) => {
692
+ this._log.info('getIamPolicy response %j', response);
693
+ return [response, options, rawResponse];
694
+ })
695
+ .catch((error) => {
696
+ if (error &&
697
+ 'statusDetails' in error &&
698
+ error.statusDetails instanceof Array) {
699
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
700
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
701
+ }
702
+ throw error;
703
+ });
515
704
  }
516
705
  testIamPermissions(request, optionsOrCallback, callback) {
517
- var _a;
518
706
  request = request || {};
519
707
  let options;
520
708
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -529,13 +717,35 @@ class InstanceAdminClient {
529
717
  options.otherArgs.headers = options.otherArgs.headers || {};
530
718
  options.otherArgs.headers['x-goog-request-params'] =
531
719
  this._gaxModule.routingHeader.fromParams({
532
- resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
720
+ resource: request.resource ?? '',
533
721
  });
534
- this.initialize();
535
- return this.innerApiCalls.testIamPermissions(request, options, callback);
722
+ this.initialize().catch(err => {
723
+ throw err;
724
+ });
725
+ this._log.info('testIamPermissions request %j', request);
726
+ const wrappedCallback = callback
727
+ ? (error, response, options, rawResponse) => {
728
+ this._log.info('testIamPermissions response %j', response);
729
+ callback(error, response, options, rawResponse); // We verified callback above.
730
+ }
731
+ : undefined;
732
+ return this.innerApiCalls
733
+ .testIamPermissions(request, options, wrappedCallback)
734
+ ?.then(([response, options, rawResponse]) => {
735
+ this._log.info('testIamPermissions response %j', response);
736
+ return [response, options, rawResponse];
737
+ })
738
+ .catch((error) => {
739
+ if (error &&
740
+ 'statusDetails' in error &&
741
+ error.statusDetails instanceof Array) {
742
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
743
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
744
+ }
745
+ throw error;
746
+ });
536
747
  }
537
748
  getInstancePartition(request, optionsOrCallback, callback) {
538
- var _a;
539
749
  request = request || {};
540
750
  let options;
541
751
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -550,13 +760,35 @@ class InstanceAdminClient {
550
760
  options.otherArgs.headers = options.otherArgs.headers || {};
551
761
  options.otherArgs.headers['x-goog-request-params'] =
552
762
  this._gaxModule.routingHeader.fromParams({
553
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
763
+ name: request.name ?? '',
554
764
  });
555
- this.initialize();
556
- return this.innerApiCalls.getInstancePartition(request, options, callback);
765
+ this.initialize().catch(err => {
766
+ throw err;
767
+ });
768
+ this._log.info('getInstancePartition request %j', request);
769
+ const wrappedCallback = callback
770
+ ? (error, response, options, rawResponse) => {
771
+ this._log.info('getInstancePartition response %j', response);
772
+ callback(error, response, options, rawResponse); // We verified callback above.
773
+ }
774
+ : undefined;
775
+ return this.innerApiCalls
776
+ .getInstancePartition(request, options, wrappedCallback)
777
+ ?.then(([response, options, rawResponse]) => {
778
+ this._log.info('getInstancePartition response %j', response);
779
+ return [response, options, rawResponse];
780
+ })
781
+ .catch((error) => {
782
+ if (error &&
783
+ 'statusDetails' in error &&
784
+ error.statusDetails instanceof Array) {
785
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
786
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
787
+ }
788
+ throw error;
789
+ });
557
790
  }
558
791
  deleteInstancePartition(request, optionsOrCallback, callback) {
559
- var _a;
560
792
  request = request || {};
561
793
  let options;
562
794
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -571,13 +803,35 @@ class InstanceAdminClient {
571
803
  options.otherArgs.headers = options.otherArgs.headers || {};
572
804
  options.otherArgs.headers['x-goog-request-params'] =
573
805
  this._gaxModule.routingHeader.fromParams({
574
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
806
+ name: request.name ?? '',
575
807
  });
576
- this.initialize();
577
- return this.innerApiCalls.deleteInstancePartition(request, options, callback);
808
+ this.initialize().catch(err => {
809
+ throw err;
810
+ });
811
+ this._log.info('deleteInstancePartition request %j', request);
812
+ const wrappedCallback = callback
813
+ ? (error, response, options, rawResponse) => {
814
+ this._log.info('deleteInstancePartition response %j', response);
815
+ callback(error, response, options, rawResponse); // We verified callback above.
816
+ }
817
+ : undefined;
818
+ return this.innerApiCalls
819
+ .deleteInstancePartition(request, options, wrappedCallback)
820
+ ?.then(([response, options, rawResponse]) => {
821
+ this._log.info('deleteInstancePartition response %j', response);
822
+ return [response, options, rawResponse];
823
+ })
824
+ .catch((error) => {
825
+ if (error &&
826
+ 'statusDetails' in error &&
827
+ error.statusDetails instanceof Array) {
828
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
829
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
830
+ }
831
+ throw error;
832
+ });
578
833
  }
579
834
  createInstanceConfig(request, optionsOrCallback, callback) {
580
- var _a;
581
835
  request = request || {};
582
836
  let options;
583
837
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -592,10 +846,24 @@ class InstanceAdminClient {
592
846
  options.otherArgs.headers = options.otherArgs.headers || {};
593
847
  options.otherArgs.headers['x-goog-request-params'] =
594
848
  this._gaxModule.routingHeader.fromParams({
595
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
849
+ parent: request.parent ?? '',
596
850
  });
597
- this.initialize();
598
- return this.innerApiCalls.createInstanceConfig(request, options, callback);
851
+ this.initialize().catch(err => {
852
+ throw err;
853
+ });
854
+ const wrappedCallback = callback
855
+ ? (error, response, rawResponse, _) => {
856
+ this._log.info('createInstanceConfig response %j', rawResponse);
857
+ callback(error, response, rawResponse, _); // We verified callback above.
858
+ }
859
+ : undefined;
860
+ this._log.info('createInstanceConfig request %j', request);
861
+ return this.innerApiCalls
862
+ .createInstanceConfig(request, options, wrappedCallback)
863
+ ?.then(([response, rawResponse, _]) => {
864
+ this._log.info('createInstanceConfig response %j', rawResponse);
865
+ return [response, rawResponse, _];
866
+ });
599
867
  }
600
868
  /**
601
869
  * Check the status of the long running operation returned by `createInstanceConfig()`.
@@ -607,13 +875,13 @@ class InstanceAdminClient {
607
875
  * for more details and examples.
608
876
  */
609
877
  async checkCreateInstanceConfigProgress(name) {
878
+ this._log.info('createInstanceConfig long-running');
610
879
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
611
880
  const [operation] = await this.operationsClient.getOperation(request);
612
881
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
613
882
  return decodeOperation;
614
883
  }
615
884
  updateInstanceConfig(request, optionsOrCallback, callback) {
616
- var _a;
617
885
  request = request || {};
618
886
  let options;
619
887
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -628,10 +896,24 @@ class InstanceAdminClient {
628
896
  options.otherArgs.headers = options.otherArgs.headers || {};
629
897
  options.otherArgs.headers['x-goog-request-params'] =
630
898
  this._gaxModule.routingHeader.fromParams({
631
- 'instance_config.name': (_a = request.instanceConfig.name) !== null && _a !== void 0 ? _a : '',
899
+ 'instance_config.name': request.instanceConfig.name ?? '',
632
900
  });
633
- this.initialize();
634
- return this.innerApiCalls.updateInstanceConfig(request, options, callback);
901
+ this.initialize().catch(err => {
902
+ throw err;
903
+ });
904
+ const wrappedCallback = callback
905
+ ? (error, response, rawResponse, _) => {
906
+ this._log.info('updateInstanceConfig response %j', rawResponse);
907
+ callback(error, response, rawResponse, _); // We verified callback above.
908
+ }
909
+ : undefined;
910
+ this._log.info('updateInstanceConfig request %j', request);
911
+ return this.innerApiCalls
912
+ .updateInstanceConfig(request, options, wrappedCallback)
913
+ ?.then(([response, rawResponse, _]) => {
914
+ this._log.info('updateInstanceConfig response %j', rawResponse);
915
+ return [response, rawResponse, _];
916
+ });
635
917
  }
636
918
  /**
637
919
  * Check the status of the long running operation returned by `updateInstanceConfig()`.
@@ -643,13 +925,13 @@ class InstanceAdminClient {
643
925
  * for more details and examples.
644
926
  */
645
927
  async checkUpdateInstanceConfigProgress(name) {
928
+ this._log.info('updateInstanceConfig long-running');
646
929
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
647
930
  const [operation] = await this.operationsClient.getOperation(request);
648
931
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
649
932
  return decodeOperation;
650
933
  }
651
934
  createInstance(request, optionsOrCallback, callback) {
652
- var _a;
653
935
  request = request || {};
654
936
  let options;
655
937
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -664,10 +946,24 @@ class InstanceAdminClient {
664
946
  options.otherArgs.headers = options.otherArgs.headers || {};
665
947
  options.otherArgs.headers['x-goog-request-params'] =
666
948
  this._gaxModule.routingHeader.fromParams({
667
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
949
+ parent: request.parent ?? '',
668
950
  });
669
- this.initialize();
670
- return this.innerApiCalls.createInstance(request, options, callback);
951
+ this.initialize().catch(err => {
952
+ throw err;
953
+ });
954
+ const wrappedCallback = callback
955
+ ? (error, response, rawResponse, _) => {
956
+ this._log.info('createInstance response %j', rawResponse);
957
+ callback(error, response, rawResponse, _); // We verified callback above.
958
+ }
959
+ : undefined;
960
+ this._log.info('createInstance request %j', request);
961
+ return this.innerApiCalls
962
+ .createInstance(request, options, wrappedCallback)
963
+ ?.then(([response, rawResponse, _]) => {
964
+ this._log.info('createInstance response %j', rawResponse);
965
+ return [response, rawResponse, _];
966
+ });
671
967
  }
672
968
  /**
673
969
  * Check the status of the long running operation returned by `createInstance()`.
@@ -679,13 +975,13 @@ class InstanceAdminClient {
679
975
  * for more details and examples.
680
976
  */
681
977
  async checkCreateInstanceProgress(name) {
978
+ this._log.info('createInstance long-running');
682
979
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
683
980
  const [operation] = await this.operationsClient.getOperation(request);
684
981
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings());
685
982
  return decodeOperation;
686
983
  }
687
984
  updateInstance(request, optionsOrCallback, callback) {
688
- var _a;
689
985
  request = request || {};
690
986
  let options;
691
987
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -700,10 +996,24 @@ class InstanceAdminClient {
700
996
  options.otherArgs.headers = options.otherArgs.headers || {};
701
997
  options.otherArgs.headers['x-goog-request-params'] =
702
998
  this._gaxModule.routingHeader.fromParams({
703
- 'instance.name': (_a = request.instance.name) !== null && _a !== void 0 ? _a : '',
999
+ 'instance.name': request.instance.name ?? '',
704
1000
  });
705
- this.initialize();
706
- return this.innerApiCalls.updateInstance(request, options, callback);
1001
+ this.initialize().catch(err => {
1002
+ throw err;
1003
+ });
1004
+ const wrappedCallback = callback
1005
+ ? (error, response, rawResponse, _) => {
1006
+ this._log.info('updateInstance response %j', rawResponse);
1007
+ callback(error, response, rawResponse, _); // We verified callback above.
1008
+ }
1009
+ : undefined;
1010
+ this._log.info('updateInstance request %j', request);
1011
+ return this.innerApiCalls
1012
+ .updateInstance(request, options, wrappedCallback)
1013
+ ?.then(([response, rawResponse, _]) => {
1014
+ this._log.info('updateInstance response %j', rawResponse);
1015
+ return [response, rawResponse, _];
1016
+ });
707
1017
  }
708
1018
  /**
709
1019
  * Check the status of the long running operation returned by `updateInstance()`.
@@ -715,13 +1025,13 @@ class InstanceAdminClient {
715
1025
  * for more details and examples.
716
1026
  */
717
1027
  async checkUpdateInstanceProgress(name) {
1028
+ this._log.info('updateInstance long-running');
718
1029
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
719
1030
  const [operation] = await this.operationsClient.getOperation(request);
720
1031
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
721
1032
  return decodeOperation;
722
1033
  }
723
1034
  createInstancePartition(request, optionsOrCallback, callback) {
724
- var _a;
725
1035
  request = request || {};
726
1036
  let options;
727
1037
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -736,10 +1046,24 @@ class InstanceAdminClient {
736
1046
  options.otherArgs.headers = options.otherArgs.headers || {};
737
1047
  options.otherArgs.headers['x-goog-request-params'] =
738
1048
  this._gaxModule.routingHeader.fromParams({
739
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1049
+ parent: request.parent ?? '',
740
1050
  });
741
- this.initialize();
742
- return this.innerApiCalls.createInstancePartition(request, options, callback);
1051
+ this.initialize().catch(err => {
1052
+ throw err;
1053
+ });
1054
+ const wrappedCallback = callback
1055
+ ? (error, response, rawResponse, _) => {
1056
+ this._log.info('createInstancePartition response %j', rawResponse);
1057
+ callback(error, response, rawResponse, _); // We verified callback above.
1058
+ }
1059
+ : undefined;
1060
+ this._log.info('createInstancePartition request %j', request);
1061
+ return this.innerApiCalls
1062
+ .createInstancePartition(request, options, wrappedCallback)
1063
+ ?.then(([response, rawResponse, _]) => {
1064
+ this._log.info('createInstancePartition response %j', rawResponse);
1065
+ return [response, rawResponse, _];
1066
+ });
743
1067
  }
744
1068
  /**
745
1069
  * Check the status of the long running operation returned by `createInstancePartition()`.
@@ -751,13 +1075,13 @@ class InstanceAdminClient {
751
1075
  * for more details and examples.
752
1076
  */
753
1077
  async checkCreateInstancePartitionProgress(name) {
1078
+ this._log.info('createInstancePartition long-running');
754
1079
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
755
1080
  const [operation] = await this.operationsClient.getOperation(request);
756
1081
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstancePartition, this._gaxModule.createDefaultBackoffSettings());
757
1082
  return decodeOperation;
758
1083
  }
759
1084
  updateInstancePartition(request, optionsOrCallback, callback) {
760
- var _a;
761
1085
  request = request || {};
762
1086
  let options;
763
1087
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -772,10 +1096,24 @@ class InstanceAdminClient {
772
1096
  options.otherArgs.headers = options.otherArgs.headers || {};
773
1097
  options.otherArgs.headers['x-goog-request-params'] =
774
1098
  this._gaxModule.routingHeader.fromParams({
775
- 'instance_partition.name': (_a = request.instancePartition.name) !== null && _a !== void 0 ? _a : '',
1099
+ 'instance_partition.name': request.instancePartition.name ?? '',
776
1100
  });
777
- this.initialize();
778
- return this.innerApiCalls.updateInstancePartition(request, options, callback);
1101
+ this.initialize().catch(err => {
1102
+ throw err;
1103
+ });
1104
+ const wrappedCallback = callback
1105
+ ? (error, response, rawResponse, _) => {
1106
+ this._log.info('updateInstancePartition response %j', rawResponse);
1107
+ callback(error, response, rawResponse, _); // We verified callback above.
1108
+ }
1109
+ : undefined;
1110
+ this._log.info('updateInstancePartition request %j', request);
1111
+ return this.innerApiCalls
1112
+ .updateInstancePartition(request, options, wrappedCallback)
1113
+ ?.then(([response, rawResponse, _]) => {
1114
+ this._log.info('updateInstancePartition response %j', rawResponse);
1115
+ return [response, rawResponse, _];
1116
+ });
779
1117
  }
780
1118
  /**
781
1119
  * Check the status of the long running operation returned by `updateInstancePartition()`.
@@ -787,13 +1125,13 @@ class InstanceAdminClient {
787
1125
  * for more details and examples.
788
1126
  */
789
1127
  async checkUpdateInstancePartitionProgress(name) {
1128
+ this._log.info('updateInstancePartition long-running');
790
1129
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
791
1130
  const [operation] = await this.operationsClient.getOperation(request);
792
1131
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings());
793
1132
  return decodeOperation;
794
1133
  }
795
1134
  moveInstance(request, optionsOrCallback, callback) {
796
- var _a;
797
1135
  request = request || {};
798
1136
  let options;
799
1137
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -808,10 +1146,24 @@ class InstanceAdminClient {
808
1146
  options.otherArgs.headers = options.otherArgs.headers || {};
809
1147
  options.otherArgs.headers['x-goog-request-params'] =
810
1148
  this._gaxModule.routingHeader.fromParams({
811
- name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
1149
+ name: request.name ?? '',
812
1150
  });
813
- this.initialize();
814
- return this.innerApiCalls.moveInstance(request, options, callback);
1151
+ this.initialize().catch(err => {
1152
+ throw err;
1153
+ });
1154
+ const wrappedCallback = callback
1155
+ ? (error, response, rawResponse, _) => {
1156
+ this._log.info('moveInstance response %j', rawResponse);
1157
+ callback(error, response, rawResponse, _); // We verified callback above.
1158
+ }
1159
+ : undefined;
1160
+ this._log.info('moveInstance request %j', request);
1161
+ return this.innerApiCalls
1162
+ .moveInstance(request, options, wrappedCallback)
1163
+ ?.then(([response, rawResponse, _]) => {
1164
+ this._log.info('moveInstance response %j', rawResponse);
1165
+ return [response, rawResponse, _];
1166
+ });
815
1167
  }
816
1168
  /**
817
1169
  * Check the status of the long running operation returned by `moveInstance()`.
@@ -823,13 +1175,13 @@ class InstanceAdminClient {
823
1175
  * for more details and examples.
824
1176
  */
825
1177
  async checkMoveInstanceProgress(name) {
1178
+ this._log.info('moveInstance long-running');
826
1179
  const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
827
1180
  const [operation] = await this.operationsClient.getOperation(request);
828
1181
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings());
829
1182
  return decodeOperation;
830
1183
  }
831
1184
  listInstanceConfigs(request, optionsOrCallback, callback) {
832
- var _a;
833
1185
  request = request || {};
834
1186
  let options;
835
1187
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -844,10 +1196,24 @@ class InstanceAdminClient {
844
1196
  options.otherArgs.headers = options.otherArgs.headers || {};
845
1197
  options.otherArgs.headers['x-goog-request-params'] =
846
1198
  this._gaxModule.routingHeader.fromParams({
847
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1199
+ parent: request.parent ?? '',
848
1200
  });
849
- this.initialize();
850
- return this.innerApiCalls.listInstanceConfigs(request, options, callback);
1201
+ this.initialize().catch(err => {
1202
+ throw err;
1203
+ });
1204
+ const wrappedCallback = callback
1205
+ ? (error, values, nextPageRequest, rawResponse) => {
1206
+ this._log.info('listInstanceConfigs values %j', values);
1207
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1208
+ }
1209
+ : undefined;
1210
+ this._log.info('listInstanceConfigs request %j', request);
1211
+ return this.innerApiCalls
1212
+ .listInstanceConfigs(request, options, wrappedCallback)
1213
+ ?.then(([response, input, output]) => {
1214
+ this._log.info('listInstanceConfigs values %j', response);
1215
+ return [response, input, output];
1216
+ });
851
1217
  }
852
1218
  /**
853
1219
  * Equivalent to `listInstanceConfigs`, but returns a NodeJS Stream object.
@@ -877,18 +1243,20 @@ class InstanceAdminClient {
877
1243
  * for more details and examples.
878
1244
  */
879
1245
  listInstanceConfigsStream(request, options) {
880
- var _a;
881
1246
  request = request || {};
882
1247
  options = options || {};
883
1248
  options.otherArgs = options.otherArgs || {};
884
1249
  options.otherArgs.headers = options.otherArgs.headers || {};
885
1250
  options.otherArgs.headers['x-goog-request-params'] =
886
1251
  this._gaxModule.routingHeader.fromParams({
887
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1252
+ parent: request.parent ?? '',
888
1253
  });
889
1254
  const defaultCallSettings = this._defaults['listInstanceConfigs'];
890
1255
  const callSettings = defaultCallSettings.merge(options);
891
- this.initialize();
1256
+ this.initialize().catch(err => {
1257
+ throw err;
1258
+ });
1259
+ this._log.info('listInstanceConfigs stream %j', request);
892
1260
  return this.descriptors.page.listInstanceConfigs.createStream(this.innerApiCalls.listInstanceConfigs, request, callSettings);
893
1261
  }
894
1262
  /**
@@ -920,22 +1288,23 @@ class InstanceAdminClient {
920
1288
  * for more details and examples.
921
1289
  */
922
1290
  listInstanceConfigsAsync(request, options) {
923
- var _a;
924
1291
  request = request || {};
925
1292
  options = options || {};
926
1293
  options.otherArgs = options.otherArgs || {};
927
1294
  options.otherArgs.headers = options.otherArgs.headers || {};
928
1295
  options.otherArgs.headers['x-goog-request-params'] =
929
1296
  this._gaxModule.routingHeader.fromParams({
930
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1297
+ parent: request.parent ?? '',
931
1298
  });
932
1299
  const defaultCallSettings = this._defaults['listInstanceConfigs'];
933
1300
  const callSettings = defaultCallSettings.merge(options);
934
- this.initialize();
1301
+ this.initialize().catch(err => {
1302
+ throw err;
1303
+ });
1304
+ this._log.info('listInstanceConfigs iterate %j', request);
935
1305
  return this.descriptors.page.listInstanceConfigs.asyncIterate(this.innerApiCalls['listInstanceConfigs'], request, callSettings);
936
1306
  }
937
1307
  listInstanceConfigOperations(request, optionsOrCallback, callback) {
938
- var _a;
939
1308
  request = request || {};
940
1309
  let options;
941
1310
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -950,10 +1319,24 @@ class InstanceAdminClient {
950
1319
  options.otherArgs.headers = options.otherArgs.headers || {};
951
1320
  options.otherArgs.headers['x-goog-request-params'] =
952
1321
  this._gaxModule.routingHeader.fromParams({
953
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1322
+ parent: request.parent ?? '',
954
1323
  });
955
- this.initialize();
956
- return this.innerApiCalls.listInstanceConfigOperations(request, options, callback);
1324
+ this.initialize().catch(err => {
1325
+ throw err;
1326
+ });
1327
+ const wrappedCallback = callback
1328
+ ? (error, values, nextPageRequest, rawResponse) => {
1329
+ this._log.info('listInstanceConfigOperations values %j', values);
1330
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1331
+ }
1332
+ : undefined;
1333
+ this._log.info('listInstanceConfigOperations request %j', request);
1334
+ return this.innerApiCalls
1335
+ .listInstanceConfigOperations(request, options, wrappedCallback)
1336
+ ?.then(([response, input, output]) => {
1337
+ this._log.info('listInstanceConfigOperations values %j', response);
1338
+ return [response, input, output];
1339
+ });
957
1340
  }
958
1341
  /**
959
1342
  * Equivalent to `listInstanceConfigOperations`, but returns a NodeJS Stream object.
@@ -1026,18 +1409,20 @@ class InstanceAdminClient {
1026
1409
  * for more details and examples.
1027
1410
  */
1028
1411
  listInstanceConfigOperationsStream(request, options) {
1029
- var _a;
1030
1412
  request = request || {};
1031
1413
  options = options || {};
1032
1414
  options.otherArgs = options.otherArgs || {};
1033
1415
  options.otherArgs.headers = options.otherArgs.headers || {};
1034
1416
  options.otherArgs.headers['x-goog-request-params'] =
1035
1417
  this._gaxModule.routingHeader.fromParams({
1036
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1418
+ parent: request.parent ?? '',
1037
1419
  });
1038
1420
  const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1039
1421
  const callSettings = defaultCallSettings.merge(options);
1040
- this.initialize();
1422
+ this.initialize().catch(err => {
1423
+ throw err;
1424
+ });
1425
+ this._log.info('listInstanceConfigOperations stream %j', request);
1041
1426
  return this.descriptors.page.listInstanceConfigOperations.createStream(this.innerApiCalls.listInstanceConfigOperations, request, callSettings);
1042
1427
  }
1043
1428
  /**
@@ -1112,22 +1497,23 @@ class InstanceAdminClient {
1112
1497
  * for more details and examples.
1113
1498
  */
1114
1499
  listInstanceConfigOperationsAsync(request, options) {
1115
- var _a;
1116
1500
  request = request || {};
1117
1501
  options = options || {};
1118
1502
  options.otherArgs = options.otherArgs || {};
1119
1503
  options.otherArgs.headers = options.otherArgs.headers || {};
1120
1504
  options.otherArgs.headers['x-goog-request-params'] =
1121
1505
  this._gaxModule.routingHeader.fromParams({
1122
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1506
+ parent: request.parent ?? '',
1123
1507
  });
1124
1508
  const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
1125
1509
  const callSettings = defaultCallSettings.merge(options);
1126
- this.initialize();
1510
+ this.initialize().catch(err => {
1511
+ throw err;
1512
+ });
1513
+ this._log.info('listInstanceConfigOperations iterate %j', request);
1127
1514
  return this.descriptors.page.listInstanceConfigOperations.asyncIterate(this.innerApiCalls['listInstanceConfigOperations'], request, callSettings);
1128
1515
  }
1129
1516
  listInstances(request, optionsOrCallback, callback) {
1130
- var _a;
1131
1517
  request = request || {};
1132
1518
  let options;
1133
1519
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1142,10 +1528,24 @@ class InstanceAdminClient {
1142
1528
  options.otherArgs.headers = options.otherArgs.headers || {};
1143
1529
  options.otherArgs.headers['x-goog-request-params'] =
1144
1530
  this._gaxModule.routingHeader.fromParams({
1145
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1531
+ parent: request.parent ?? '',
1146
1532
  });
1147
- this.initialize();
1148
- return this.innerApiCalls.listInstances(request, options, callback);
1533
+ this.initialize().catch(err => {
1534
+ throw err;
1535
+ });
1536
+ const wrappedCallback = callback
1537
+ ? (error, values, nextPageRequest, rawResponse) => {
1538
+ this._log.info('listInstances values %j', values);
1539
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1540
+ }
1541
+ : undefined;
1542
+ this._log.info('listInstances request %j', request);
1543
+ return this.innerApiCalls
1544
+ .listInstances(request, options, wrappedCallback)
1545
+ ?.then(([response, input, output]) => {
1546
+ this._log.info('listInstances values %j', response);
1547
+ return [response, input, output];
1548
+ });
1149
1549
  }
1150
1550
  /**
1151
1551
  * Equivalent to `listInstances`, but returns a NodeJS Stream object.
@@ -1201,18 +1601,20 @@ class InstanceAdminClient {
1201
1601
  * for more details and examples.
1202
1602
  */
1203
1603
  listInstancesStream(request, options) {
1204
- var _a;
1205
1604
  request = request || {};
1206
1605
  options = options || {};
1207
1606
  options.otherArgs = options.otherArgs || {};
1208
1607
  options.otherArgs.headers = options.otherArgs.headers || {};
1209
1608
  options.otherArgs.headers['x-goog-request-params'] =
1210
1609
  this._gaxModule.routingHeader.fromParams({
1211
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1610
+ parent: request.parent ?? '',
1212
1611
  });
1213
1612
  const defaultCallSettings = this._defaults['listInstances'];
1214
1613
  const callSettings = defaultCallSettings.merge(options);
1215
- this.initialize();
1614
+ this.initialize().catch(err => {
1615
+ throw err;
1616
+ });
1617
+ this._log.info('listInstances stream %j', request);
1216
1618
  return this.descriptors.page.listInstances.createStream(this.innerApiCalls.listInstances, request, callSettings);
1217
1619
  }
1218
1620
  /**
@@ -1270,22 +1672,23 @@ class InstanceAdminClient {
1270
1672
  * for more details and examples.
1271
1673
  */
1272
1674
  listInstancesAsync(request, options) {
1273
- var _a;
1274
1675
  request = request || {};
1275
1676
  options = options || {};
1276
1677
  options.otherArgs = options.otherArgs || {};
1277
1678
  options.otherArgs.headers = options.otherArgs.headers || {};
1278
1679
  options.otherArgs.headers['x-goog-request-params'] =
1279
1680
  this._gaxModule.routingHeader.fromParams({
1280
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1681
+ parent: request.parent ?? '',
1281
1682
  });
1282
1683
  const defaultCallSettings = this._defaults['listInstances'];
1283
1684
  const callSettings = defaultCallSettings.merge(options);
1284
- this.initialize();
1685
+ this.initialize().catch(err => {
1686
+ throw err;
1687
+ });
1688
+ this._log.info('listInstances iterate %j', request);
1285
1689
  return this.descriptors.page.listInstances.asyncIterate(this.innerApiCalls['listInstances'], request, callSettings);
1286
1690
  }
1287
1691
  listInstancePartitions(request, optionsOrCallback, callback) {
1288
- var _a;
1289
1692
  request = request || {};
1290
1693
  let options;
1291
1694
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1300,10 +1703,24 @@ class InstanceAdminClient {
1300
1703
  options.otherArgs.headers = options.otherArgs.headers || {};
1301
1704
  options.otherArgs.headers['x-goog-request-params'] =
1302
1705
  this._gaxModule.routingHeader.fromParams({
1303
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1706
+ parent: request.parent ?? '',
1304
1707
  });
1305
- this.initialize();
1306
- return this.innerApiCalls.listInstancePartitions(request, options, callback);
1708
+ this.initialize().catch(err => {
1709
+ throw err;
1710
+ });
1711
+ const wrappedCallback = callback
1712
+ ? (error, values, nextPageRequest, rawResponse) => {
1713
+ this._log.info('listInstancePartitions values %j', values);
1714
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1715
+ }
1716
+ : undefined;
1717
+ this._log.info('listInstancePartitions request %j', request);
1718
+ return this.innerApiCalls
1719
+ .listInstancePartitions(request, options, wrappedCallback)
1720
+ ?.then(([response, input, output]) => {
1721
+ this._log.info('listInstancePartitions values %j', response);
1722
+ return [response, input, output];
1723
+ });
1307
1724
  }
1308
1725
  /**
1309
1726
  * Equivalent to `listInstancePartitions`, but returns a NodeJS Stream object.
@@ -1341,18 +1758,20 @@ class InstanceAdminClient {
1341
1758
  * for more details and examples.
1342
1759
  */
1343
1760
  listInstancePartitionsStream(request, options) {
1344
- var _a;
1345
1761
  request = request || {};
1346
1762
  options = options || {};
1347
1763
  options.otherArgs = options.otherArgs || {};
1348
1764
  options.otherArgs.headers = options.otherArgs.headers || {};
1349
1765
  options.otherArgs.headers['x-goog-request-params'] =
1350
1766
  this._gaxModule.routingHeader.fromParams({
1351
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1767
+ parent: request.parent ?? '',
1352
1768
  });
1353
1769
  const defaultCallSettings = this._defaults['listInstancePartitions'];
1354
1770
  const callSettings = defaultCallSettings.merge(options);
1355
- this.initialize();
1771
+ this.initialize().catch(err => {
1772
+ throw err;
1773
+ });
1774
+ this._log.info('listInstancePartitions stream %j', request);
1356
1775
  return this.descriptors.page.listInstancePartitions.createStream(this.innerApiCalls.listInstancePartitions, request, callSettings);
1357
1776
  }
1358
1777
  /**
@@ -1392,22 +1811,23 @@ class InstanceAdminClient {
1392
1811
  * for more details and examples.
1393
1812
  */
1394
1813
  listInstancePartitionsAsync(request, options) {
1395
- var _a;
1396
1814
  request = request || {};
1397
1815
  options = options || {};
1398
1816
  options.otherArgs = options.otherArgs || {};
1399
1817
  options.otherArgs.headers = options.otherArgs.headers || {};
1400
1818
  options.otherArgs.headers['x-goog-request-params'] =
1401
1819
  this._gaxModule.routingHeader.fromParams({
1402
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1820
+ parent: request.parent ?? '',
1403
1821
  });
1404
1822
  const defaultCallSettings = this._defaults['listInstancePartitions'];
1405
1823
  const callSettings = defaultCallSettings.merge(options);
1406
- this.initialize();
1824
+ this.initialize().catch(err => {
1825
+ throw err;
1826
+ });
1827
+ this._log.info('listInstancePartitions iterate %j', request);
1407
1828
  return this.descriptors.page.listInstancePartitions.asyncIterate(this.innerApiCalls['listInstancePartitions'], request, callSettings);
1408
1829
  }
1409
1830
  listInstancePartitionOperations(request, optionsOrCallback, callback) {
1410
- var _a;
1411
1831
  request = request || {};
1412
1832
  let options;
1413
1833
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1422,10 +1842,24 @@ class InstanceAdminClient {
1422
1842
  options.otherArgs.headers = options.otherArgs.headers || {};
1423
1843
  options.otherArgs.headers['x-goog-request-params'] =
1424
1844
  this._gaxModule.routingHeader.fromParams({
1425
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1845
+ parent: request.parent ?? '',
1426
1846
  });
1427
- this.initialize();
1428
- return this.innerApiCalls.listInstancePartitionOperations(request, options, callback);
1847
+ this.initialize().catch(err => {
1848
+ throw err;
1849
+ });
1850
+ const wrappedCallback = callback
1851
+ ? (error, values, nextPageRequest, rawResponse) => {
1852
+ this._log.info('listInstancePartitionOperations values %j', values);
1853
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1854
+ }
1855
+ : undefined;
1856
+ this._log.info('listInstancePartitionOperations request %j', request);
1857
+ return this.innerApiCalls
1858
+ .listInstancePartitionOperations(request, options, wrappedCallback)
1859
+ ?.then(([response, input, output]) => {
1860
+ this._log.info('listInstancePartitionOperations values %j', response);
1861
+ return [response, input, output];
1862
+ });
1429
1863
  }
1430
1864
  /**
1431
1865
  * Equivalent to `listInstancePartitionOperations`, but returns a NodeJS Stream object.
@@ -1505,18 +1939,20 @@ class InstanceAdminClient {
1505
1939
  * for more details and examples.
1506
1940
  */
1507
1941
  listInstancePartitionOperationsStream(request, options) {
1508
- var _a;
1509
1942
  request = request || {};
1510
1943
  options = options || {};
1511
1944
  options.otherArgs = options.otherArgs || {};
1512
1945
  options.otherArgs.headers = options.otherArgs.headers || {};
1513
1946
  options.otherArgs.headers['x-goog-request-params'] =
1514
1947
  this._gaxModule.routingHeader.fromParams({
1515
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
1948
+ parent: request.parent ?? '',
1516
1949
  });
1517
1950
  const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1518
1951
  const callSettings = defaultCallSettings.merge(options);
1519
- this.initialize();
1952
+ this.initialize().catch(err => {
1953
+ throw err;
1954
+ });
1955
+ this._log.info('listInstancePartitionOperations stream %j', request);
1520
1956
  return this.descriptors.page.listInstancePartitionOperations.createStream(this.innerApiCalls.listInstancePartitionOperations, request, callSettings);
1521
1957
  }
1522
1958
  /**
@@ -1598,20 +2034,202 @@ class InstanceAdminClient {
1598
2034
  * for more details and examples.
1599
2035
  */
1600
2036
  listInstancePartitionOperationsAsync(request, options) {
1601
- var _a;
1602
2037
  request = request || {};
1603
2038
  options = options || {};
1604
2039
  options.otherArgs = options.otherArgs || {};
1605
2040
  options.otherArgs.headers = options.otherArgs.headers || {};
1606
2041
  options.otherArgs.headers['x-goog-request-params'] =
1607
2042
  this._gaxModule.routingHeader.fromParams({
1608
- parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
2043
+ parent: request.parent ?? '',
1609
2044
  });
1610
2045
  const defaultCallSettings = this._defaults['listInstancePartitionOperations'];
1611
2046
  const callSettings = defaultCallSettings.merge(options);
1612
- this.initialize();
2047
+ this.initialize().catch(err => {
2048
+ throw err;
2049
+ });
2050
+ this._log.info('listInstancePartitionOperations iterate %j', request);
1613
2051
  return this.descriptors.page.listInstancePartitionOperations.asyncIterate(this.innerApiCalls['listInstancePartitionOperations'], request, callSettings);
1614
2052
  }
2053
+ /**
2054
+ * Gets the latest state of a long-running operation. Clients can use this
2055
+ * method to poll the operation result at intervals as recommended by the API
2056
+ * service.
2057
+ *
2058
+ * @param {Object} request - The request object that will be sent.
2059
+ * @param {string} request.name - The name of the operation resource.
2060
+ * @param {Object=} options
2061
+ * Optional parameters. You can override the default settings for this call,
2062
+ * e.g, timeout, retries, paginations, etc. See {@link
2063
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
2064
+ * for the details.
2065
+ * @param {function(?Error, ?Object)=} callback
2066
+ * The function which will be called with the result of the API call.
2067
+ *
2068
+ * The second parameter to the callback is an object representing
2069
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
2070
+ * @return {Promise} - The promise which resolves to an array.
2071
+ * The first element of the array is an object representing
2072
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
2073
+ * The promise has a method named "cancel" which cancels the ongoing API call.
2074
+ *
2075
+ * @example
2076
+ * ```
2077
+ * const client = longrunning.operationsClient();
2078
+ * const name = '';
2079
+ * const [response] = await client.getOperation({name});
2080
+ * // doThingsWith(response)
2081
+ * ```
2082
+ */
2083
+ getOperation(request, optionsOrCallback, callback) {
2084
+ let options;
2085
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2086
+ callback = optionsOrCallback;
2087
+ options = {};
2088
+ }
2089
+ else {
2090
+ options = optionsOrCallback;
2091
+ }
2092
+ options = options || {};
2093
+ options.otherArgs = options.otherArgs || {};
2094
+ options.otherArgs.headers = options.otherArgs.headers || {};
2095
+ options.otherArgs.headers['x-goog-request-params'] =
2096
+ this._gaxModule.routingHeader.fromParams({
2097
+ name: request.name ?? '',
2098
+ });
2099
+ return this.operationsClient.getOperation(request, options, callback);
2100
+ }
2101
+ /**
2102
+ * Lists operations that match the specified filter in the request. If the
2103
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
2104
+ *
2105
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
2106
+ *
2107
+ * @param {Object} request - The request object that will be sent.
2108
+ * @param {string} request.name - The name of the operation collection.
2109
+ * @param {string} request.filter - The standard list filter.
2110
+ * @param {number=} request.pageSize -
2111
+ * The maximum number of resources contained in the underlying API
2112
+ * response. If page streaming is performed per-resource, this
2113
+ * parameter does not affect the return value. If page streaming is
2114
+ * performed per-page, this determines the maximum number of
2115
+ * resources in a page.
2116
+ * @param {Object=} options
2117
+ * Optional parameters. You can override the default settings for this call,
2118
+ * e.g, timeout, retries, paginations, etc. See {@link
2119
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
2120
+ * details.
2121
+ * @returns {Object}
2122
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
2123
+ *
2124
+ * @example
2125
+ * ```
2126
+ * const client = longrunning.operationsClient();
2127
+ * for await (const response of client.listOperationsAsync(request));
2128
+ * // doThingsWith(response)
2129
+ * ```
2130
+ */
2131
+ listOperationsAsync(request, options) {
2132
+ options = options || {};
2133
+ options.otherArgs = options.otherArgs || {};
2134
+ options.otherArgs.headers = options.otherArgs.headers || {};
2135
+ options.otherArgs.headers['x-goog-request-params'] =
2136
+ this._gaxModule.routingHeader.fromParams({
2137
+ name: request.name ?? '',
2138
+ });
2139
+ return this.operationsClient.listOperationsAsync(request, options);
2140
+ }
2141
+ /**
2142
+ * Starts asynchronous cancellation on a long-running operation. The server
2143
+ * makes a best effort to cancel the operation, but success is not
2144
+ * guaranteed. If the server doesn't support this method, it returns
2145
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
2146
+ * {@link Operations.GetOperation} or
2147
+ * other methods to check whether the cancellation succeeded or whether the
2148
+ * operation completed despite cancellation. On successful cancellation,
2149
+ * the operation is not deleted; instead, it becomes an operation with
2150
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
2151
+ * 1, corresponding to `Code.CANCELLED`.
2152
+ *
2153
+ * @param {Object} request - The request object that will be sent.
2154
+ * @param {string} request.name - The name of the operation resource to be cancelled.
2155
+ * @param {Object=} options
2156
+ * Optional parameters. You can override the default settings for this call,
2157
+ * e.g, timeout, retries, paginations, etc. See {@link
2158
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
2159
+ * details.
2160
+ * @param {function(?Error)=} callback
2161
+ * The function which will be called with the result of the API call.
2162
+ * @return {Promise} - The promise which resolves when API call finishes.
2163
+ * The promise has a method named "cancel" which cancels the ongoing API
2164
+ * call.
2165
+ *
2166
+ * @example
2167
+ * ```
2168
+ * const client = longrunning.operationsClient();
2169
+ * await client.cancelOperation({name: ''});
2170
+ * ```
2171
+ */
2172
+ cancelOperation(request, optionsOrCallback, callback) {
2173
+ let options;
2174
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2175
+ callback = optionsOrCallback;
2176
+ options = {};
2177
+ }
2178
+ else {
2179
+ options = optionsOrCallback;
2180
+ }
2181
+ options = options || {};
2182
+ options.otherArgs = options.otherArgs || {};
2183
+ options.otherArgs.headers = options.otherArgs.headers || {};
2184
+ options.otherArgs.headers['x-goog-request-params'] =
2185
+ this._gaxModule.routingHeader.fromParams({
2186
+ name: request.name ?? '',
2187
+ });
2188
+ return this.operationsClient.cancelOperation(request, options, callback);
2189
+ }
2190
+ /**
2191
+ * Deletes a long-running operation. This method indicates that the client is
2192
+ * no longer interested in the operation result. It does not cancel the
2193
+ * operation. If the server doesn't support this method, it returns
2194
+ * `google.rpc.Code.UNIMPLEMENTED`.
2195
+ *
2196
+ * @param {Object} request - The request object that will be sent.
2197
+ * @param {string} request.name - The name of the operation resource to be deleted.
2198
+ * @param {Object=} options
2199
+ * Optional parameters. You can override the default settings for this call,
2200
+ * e.g, timeout, retries, paginations, etc. See {@link
2201
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
2202
+ * for the details.
2203
+ * @param {function(?Error)=} callback
2204
+ * The function which will be called with the result of the API call.
2205
+ * @return {Promise} - The promise which resolves when API call finishes.
2206
+ * The promise has a method named "cancel" which cancels the ongoing API
2207
+ * call.
2208
+ *
2209
+ * @example
2210
+ * ```
2211
+ * const client = longrunning.operationsClient();
2212
+ * await client.deleteOperation({name: ''});
2213
+ * ```
2214
+ */
2215
+ deleteOperation(request, optionsOrCallback, callback) {
2216
+ let options;
2217
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2218
+ callback = optionsOrCallback;
2219
+ options = {};
2220
+ }
2221
+ else {
2222
+ options = optionsOrCallback;
2223
+ }
2224
+ options = options || {};
2225
+ options.otherArgs = options.otherArgs || {};
2226
+ options.otherArgs.headers = options.otherArgs.headers || {};
2227
+ options.otherArgs.headers['x-goog-request-params'] =
2228
+ this._gaxModule.routingHeader.fromParams({
2229
+ name: request.name ?? '',
2230
+ });
2231
+ return this.operationsClient.deleteOperation(request, options, callback);
2232
+ }
1615
2233
  // --------------------
1616
2234
  // -- Path templates --
1617
2235
  // --------------------
@@ -1756,9 +2374,10 @@ class InstanceAdminClient {
1756
2374
  close() {
1757
2375
  if (this.instanceAdminStub && !this._terminated) {
1758
2376
  return this.instanceAdminStub.then(stub => {
2377
+ this._log.info('ending gRPC channel');
1759
2378
  this._terminated = true;
1760
2379
  stub.close();
1761
- this.operationsClient.close();
2380
+ void this.operationsClient.close();
1762
2381
  });
1763
2382
  }
1764
2383
  return Promise.resolve();