@databricks/sdk-postgres 0.1.0-dev.2 → 0.1.0-dev.4

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.
package/src/v1/client.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
2
 
3
3
  import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
4
- import type {Call} from '@databricks/sdk-core/api';
5
- import {retryOn} from '@databricks/sdk-core/api';
6
4
  import {createDefault} from '@databricks/sdk-core/clientinfo';
7
5
  import type {Logger} from '@databricks/sdk-core/logger';
8
6
  import {NoOpLogger} from '@databricks/sdk-core/logger';
9
7
  import type {CallOptions} from '@databricks/sdk-options/call';
10
8
  import type {ClientOptions} from '@databricks/sdk-options/client';
9
+ import type {LroOptions} from '@databricks/sdk-options/lro';
11
10
  import type {HttpClient} from '@databricks/sdk-core/http';
12
11
  import {newHttpClient} from './transport';
13
12
  import {
@@ -16,6 +15,8 @@ import {
16
15
  executeHttpCall,
17
16
  marshalRequest,
18
17
  parseResponse,
18
+ executeWait,
19
+ StillRunningError,
19
20
  } from './utils';
20
21
  import pkgJson from '../../package.json' with {type: 'json'};
21
22
  import {z} from 'zod';
@@ -146,7 +147,7 @@ export class PostgresClient {
146
147
  }
147
148
 
148
149
  /** Creates a new database branch in the project. */
149
- async createBranch(
150
+ private async createBranch(
150
151
  req: CreateBranchRequest,
151
152
  options?: CallOptions
152
153
  ): Promise<Operation> {
@@ -162,7 +163,7 @@ export class PostgresClient {
162
163
  const fullUrl = query !== '' ? `${url}?${query}` : url;
163
164
  const body = marshalRequest(req.branch, marshalBranchSchema);
164
165
  let resp: Operation | undefined;
165
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
166
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
166
167
  const headers = new Headers({'Content-Type': 'application/json'});
167
168
  if (this.workspaceId !== undefined) {
168
169
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -184,7 +185,7 @@ export class PostgresClient {
184
185
  };
185
186
  await executeCall(call, options);
186
187
  if (resp === undefined) {
187
- throw new Error('API call completed without a result.');
188
+ throw new Error('operation completed without a result.');
188
189
  }
189
190
  return resp;
190
191
  }
@@ -198,7 +199,7 @@ export class PostgresClient {
198
199
  }
199
200
 
200
201
  /** Register a Postgres database in the Unity Catalog. */
201
- async createCatalog(
202
+ private async createCatalog(
202
203
  req: CreateCatalogRequest,
203
204
  options?: CallOptions
204
205
  ): Promise<Operation> {
@@ -211,7 +212,7 @@ export class PostgresClient {
211
212
  const fullUrl = query !== '' ? `${url}?${query}` : url;
212
213
  const body = marshalRequest(req.catalog, marshalCatalogSchema);
213
214
  let resp: Operation | undefined;
214
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
215
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
215
216
  const headers = new Headers({'Content-Type': 'application/json'});
216
217
  if (this.workspaceId !== undefined) {
217
218
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -233,7 +234,7 @@ export class PostgresClient {
233
234
  };
234
235
  await executeCall(call, options);
235
236
  if (resp === undefined) {
236
- throw new Error('API call completed without a result.');
237
+ throw new Error('operation completed without a result.');
237
238
  }
238
239
  return resp;
239
240
  }
@@ -251,7 +252,7 @@ export class PostgresClient {
251
252
  *
252
253
  * Creates a database in the specified branch. A branch can have multiple databases.
253
254
  */
254
- async createDatabase(
255
+ private async createDatabase(
255
256
  req: CreateDatabaseRequest,
256
257
  options?: CallOptions
257
258
  ): Promise<Operation> {
@@ -264,7 +265,7 @@ export class PostgresClient {
264
265
  const fullUrl = query !== '' ? `${url}?${query}` : url;
265
266
  const body = marshalRequest(req.database, marshalDatabaseSchema);
266
267
  let resp: Operation | undefined;
267
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
268
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
268
269
  const headers = new Headers({'Content-Type': 'application/json'});
269
270
  if (this.workspaceId !== undefined) {
270
271
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -286,7 +287,7 @@ export class PostgresClient {
286
287
  };
287
288
  await executeCall(call, options);
288
289
  if (resp === undefined) {
289
- throw new Error('API call completed without a result.');
290
+ throw new Error('operation completed without a result.');
290
291
  }
291
292
  return resp;
292
293
  }
@@ -300,7 +301,7 @@ export class PostgresClient {
300
301
  }
301
302
 
302
303
  /** Creates a new compute endpoint in the branch. */
303
- async createEndpoint(
304
+ private async createEndpoint(
304
305
  req: CreateEndpointRequest,
305
306
  options?: CallOptions
306
307
  ): Promise<Operation> {
@@ -316,7 +317,7 @@ export class PostgresClient {
316
317
  const fullUrl = query !== '' ? `${url}?${query}` : url;
317
318
  const body = marshalRequest(req.endpoint, marshalEndpointSchema);
318
319
  let resp: Operation | undefined;
319
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
320
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
320
321
  const headers = new Headers({'Content-Type': 'application/json'});
321
322
  if (this.workspaceId !== undefined) {
322
323
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -338,7 +339,7 @@ export class PostgresClient {
338
339
  };
339
340
  await executeCall(call, options);
340
341
  if (resp === undefined) {
341
- throw new Error('API call completed without a result.');
342
+ throw new Error('operation completed without a result.');
342
343
  }
343
344
  return resp;
344
345
  }
@@ -352,7 +353,7 @@ export class PostgresClient {
352
353
  }
353
354
 
354
355
  /** Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute endpoints. */
355
- async createProject(
356
+ private async createProject(
356
357
  req: CreateProjectRequest,
357
358
  options?: CallOptions
358
359
  ): Promise<Operation> {
@@ -365,7 +366,7 @@ export class PostgresClient {
365
366
  const fullUrl = query !== '' ? `${url}?${query}` : url;
366
367
  const body = marshalRequest(req.project, marshalProjectSchema);
367
368
  let resp: Operation | undefined;
368
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
369
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
369
370
  const headers = new Headers({'Content-Type': 'application/json'});
370
371
  if (this.workspaceId !== undefined) {
371
372
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -387,7 +388,7 @@ export class PostgresClient {
387
388
  };
388
389
  await executeCall(call, options);
389
390
  if (resp === undefined) {
390
- throw new Error('API call completed without a result.');
391
+ throw new Error('operation completed without a result.');
391
392
  }
392
393
  return resp;
393
394
  }
@@ -401,7 +402,7 @@ export class PostgresClient {
401
402
  }
402
403
 
403
404
  /** Creates a new Postgres role in the branch. */
404
- async createRole(
405
+ private async createRole(
405
406
  req: CreateRoleRequest,
406
407
  options?: CallOptions
407
408
  ): Promise<Operation> {
@@ -414,7 +415,7 @@ export class PostgresClient {
414
415
  const fullUrl = query !== '' ? `${url}?${query}` : url;
415
416
  const body = marshalRequest(req.role, marshalRoleSchema);
416
417
  let resp: Operation | undefined;
417
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
418
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
418
419
  const headers = new Headers({'Content-Type': 'application/json'});
419
420
  if (this.workspaceId !== undefined) {
420
421
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -436,7 +437,7 @@ export class PostgresClient {
436
437
  };
437
438
  await executeCall(call, options);
438
439
  if (resp === undefined) {
439
- throw new Error('API call completed without a result.');
440
+ throw new Error('operation completed without a result.');
440
441
  }
441
442
  return resp;
442
443
  }
@@ -450,7 +451,7 @@ export class PostgresClient {
450
451
  }
451
452
 
452
453
  /** Create a Synced Table. */
453
- async createSyncedTable(
454
+ private async createSyncedTable(
454
455
  req: CreateSyncedTableRequest,
455
456
  options?: CallOptions
456
457
  ): Promise<Operation> {
@@ -463,7 +464,7 @@ export class PostgresClient {
463
464
  const fullUrl = query !== '' ? `${url}?${query}` : url;
464
465
  const body = marshalRequest(req.syncedTable, marshalSyncedTableSchema);
465
466
  let resp: Operation | undefined;
466
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
467
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
467
468
  const headers = new Headers({'Content-Type': 'application/json'});
468
469
  if (this.workspaceId !== undefined) {
469
470
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -485,7 +486,7 @@ export class PostgresClient {
485
486
  };
486
487
  await executeCall(call, options);
487
488
  if (resp === undefined) {
488
- throw new Error('API call completed without a result.');
489
+ throw new Error('operation completed without a result.');
489
490
  }
490
491
  return resp;
491
492
  }
@@ -499,7 +500,7 @@ export class PostgresClient {
499
500
  }
500
501
 
501
502
  /** Deletes the specified database branch. */
502
- async deleteBranch(
503
+ private async deleteBranch(
503
504
  req: DeleteBranchRequest,
504
505
  options?: CallOptions
505
506
  ): Promise<Operation> {
@@ -511,7 +512,7 @@ export class PostgresClient {
511
512
  const query = params.toString();
512
513
  const fullUrl = query !== '' ? `${url}?${query}` : url;
513
514
  let resp: Operation | undefined;
514
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
515
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
515
516
  const headers = new Headers();
516
517
  if (this.workspaceId !== undefined) {
517
518
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -527,7 +528,7 @@ export class PostgresClient {
527
528
  };
528
529
  await executeCall(call, options);
529
530
  if (resp === undefined) {
530
- throw new Error('API call completed without a result.');
531
+ throw new Error('operation completed without a result.');
531
532
  }
532
533
  return resp;
533
534
  }
@@ -541,13 +542,13 @@ export class PostgresClient {
541
542
  }
542
543
 
543
544
  /** Delete a Database Catalog. */
544
- async deleteCatalog(
545
+ private async deleteCatalog(
545
546
  req: DeleteCatalogRequest,
546
547
  options?: CallOptions
547
548
  ): Promise<Operation> {
548
549
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
549
550
  let resp: Operation | undefined;
550
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
551
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
551
552
  const headers = new Headers();
552
553
  if (this.workspaceId !== undefined) {
553
554
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -563,7 +564,7 @@ export class PostgresClient {
563
564
  };
564
565
  await executeCall(call, options);
565
566
  if (resp === undefined) {
566
- throw new Error('API call completed without a result.');
567
+ throw new Error('operation completed without a result.');
567
568
  }
568
569
  return resp;
569
570
  }
@@ -577,13 +578,13 @@ export class PostgresClient {
577
578
  }
578
579
 
579
580
  /** Delete a Database. */
580
- async deleteDatabase(
581
+ private async deleteDatabase(
581
582
  req: DeleteDatabaseRequest,
582
583
  options?: CallOptions
583
584
  ): Promise<Operation> {
584
585
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
585
586
  let resp: Operation | undefined;
586
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
587
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
587
588
  const headers = new Headers();
588
589
  if (this.workspaceId !== undefined) {
589
590
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -599,7 +600,7 @@ export class PostgresClient {
599
600
  };
600
601
  await executeCall(call, options);
601
602
  if (resp === undefined) {
602
- throw new Error('API call completed without a result.');
603
+ throw new Error('operation completed without a result.');
603
604
  }
604
605
  return resp;
605
606
  }
@@ -613,13 +614,13 @@ export class PostgresClient {
613
614
  }
614
615
 
615
616
  /** Deletes the specified compute endpoint. */
616
- async deleteEndpoint(
617
+ private async deleteEndpoint(
617
618
  req: DeleteEndpointRequest,
618
619
  options?: CallOptions
619
620
  ): Promise<Operation> {
620
621
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
621
622
  let resp: Operation | undefined;
622
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
623
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
623
624
  const headers = new Headers();
624
625
  if (this.workspaceId !== undefined) {
625
626
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -635,7 +636,7 @@ export class PostgresClient {
635
636
  };
636
637
  await executeCall(call, options);
637
638
  if (resp === undefined) {
638
- throw new Error('API call completed without a result.');
639
+ throw new Error('operation completed without a result.');
639
640
  }
640
641
  return resp;
641
642
  }
@@ -649,7 +650,7 @@ export class PostgresClient {
649
650
  }
650
651
 
651
652
  /** Deletes the specified database project. */
652
- async deleteProject(
653
+ private async deleteProject(
653
654
  req: DeleteProjectRequest,
654
655
  options?: CallOptions
655
656
  ): Promise<Operation> {
@@ -661,7 +662,7 @@ export class PostgresClient {
661
662
  const query = params.toString();
662
663
  const fullUrl = query !== '' ? `${url}?${query}` : url;
663
664
  let resp: Operation | undefined;
664
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
665
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
665
666
  const headers = new Headers();
666
667
  if (this.workspaceId !== undefined) {
667
668
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -677,7 +678,7 @@ export class PostgresClient {
677
678
  };
678
679
  await executeCall(call, options);
679
680
  if (resp === undefined) {
680
- throw new Error('API call completed without a result.');
681
+ throw new Error('operation completed without a result.');
681
682
  }
682
683
  return resp;
683
684
  }
@@ -691,7 +692,7 @@ export class PostgresClient {
691
692
  }
692
693
 
693
694
  /** Deletes the specified Postgres role. */
694
- async deleteRole(
695
+ private async deleteRole(
695
696
  req: DeleteRoleRequest,
696
697
  options?: CallOptions
697
698
  ): Promise<Operation> {
@@ -703,7 +704,7 @@ export class PostgresClient {
703
704
  const query = params.toString();
704
705
  const fullUrl = query !== '' ? `${url}?${query}` : url;
705
706
  let resp: Operation | undefined;
706
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
707
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
707
708
  const headers = new Headers();
708
709
  if (this.workspaceId !== undefined) {
709
710
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -719,7 +720,7 @@ export class PostgresClient {
719
720
  };
720
721
  await executeCall(call, options);
721
722
  if (resp === undefined) {
722
- throw new Error('API call completed without a result.');
723
+ throw new Error('operation completed without a result.');
723
724
  }
724
725
  return resp;
725
726
  }
@@ -733,13 +734,13 @@ export class PostgresClient {
733
734
  }
734
735
 
735
736
  /** Delete a Synced Table. */
736
- async deleteSyncedTable(
737
+ private async deleteSyncedTable(
737
738
  req: DeleteSyncedTableRequest,
738
739
  options?: CallOptions
739
740
  ): Promise<Operation> {
740
741
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
741
742
  let resp: Operation | undefined;
742
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
743
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
743
744
  const headers = new Headers();
744
745
  if (this.workspaceId !== undefined) {
745
746
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -755,7 +756,7 @@ export class PostgresClient {
755
756
  };
756
757
  await executeCall(call, options);
757
758
  if (resp === undefined) {
758
- throw new Error('API call completed without a result.');
759
+ throw new Error('operation completed without a result.');
759
760
  }
760
761
  return resp;
761
762
  }
@@ -779,7 +780,7 @@ export class PostgresClient {
779
780
  marshalGenerateDatabaseCredentialRequestSchema
780
781
  );
781
782
  let resp: DatabaseCredential | undefined;
782
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
783
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
783
784
  const headers = new Headers({'Content-Type': 'application/json'});
784
785
  if (this.workspaceId !== undefined) {
785
786
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -795,7 +796,7 @@ export class PostgresClient {
795
796
  };
796
797
  await executeCall(call, options);
797
798
  if (resp === undefined) {
798
- throw new Error('API call completed without a result.');
799
+ throw new Error('operation completed without a result.');
799
800
  }
800
801
  return resp;
801
802
  }
@@ -807,7 +808,7 @@ export class PostgresClient {
807
808
  ): Promise<Branch> {
808
809
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
809
810
  let resp: Branch | undefined;
810
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
811
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
811
812
  const headers = new Headers();
812
813
  if (this.workspaceId !== undefined) {
813
814
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -823,7 +824,7 @@ export class PostgresClient {
823
824
  };
824
825
  await executeCall(call, options);
825
826
  if (resp === undefined) {
826
- throw new Error('API call completed without a result.');
827
+ throw new Error('operation completed without a result.');
827
828
  }
828
829
  return resp;
829
830
  }
@@ -835,7 +836,7 @@ export class PostgresClient {
835
836
  ): Promise<Catalog> {
836
837
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
837
838
  let resp: Catalog | undefined;
838
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
839
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
839
840
  const headers = new Headers();
840
841
  if (this.workspaceId !== undefined) {
841
842
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -851,7 +852,7 @@ export class PostgresClient {
851
852
  };
852
853
  await executeCall(call, options);
853
854
  if (resp === undefined) {
854
- throw new Error('API call completed without a result.');
855
+ throw new Error('operation completed without a result.');
855
856
  }
856
857
  return resp;
857
858
  }
@@ -863,7 +864,7 @@ export class PostgresClient {
863
864
  ): Promise<Database> {
864
865
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
865
866
  let resp: Database | undefined;
866
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
867
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
867
868
  const headers = new Headers();
868
869
  if (this.workspaceId !== undefined) {
869
870
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -879,7 +880,7 @@ export class PostgresClient {
879
880
  };
880
881
  await executeCall(call, options);
881
882
  if (resp === undefined) {
882
- throw new Error('API call completed without a result.');
883
+ throw new Error('operation completed without a result.');
883
884
  }
884
885
  return resp;
885
886
  }
@@ -891,7 +892,7 @@ export class PostgresClient {
891
892
  ): Promise<Endpoint> {
892
893
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
893
894
  let resp: Endpoint | undefined;
894
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
895
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
895
896
  const headers = new Headers();
896
897
  if (this.workspaceId !== undefined) {
897
898
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -907,7 +908,7 @@ export class PostgresClient {
907
908
  };
908
909
  await executeCall(call, options);
909
910
  if (resp === undefined) {
910
- throw new Error('API call completed without a result.');
911
+ throw new Error('operation completed without a result.');
911
912
  }
912
913
  return resp;
913
914
  }
@@ -919,7 +920,7 @@ export class PostgresClient {
919
920
  ): Promise<Operation> {
920
921
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
921
922
  let resp: Operation | undefined;
922
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
923
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
923
924
  const headers = new Headers();
924
925
  if (this.workspaceId !== undefined) {
925
926
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -935,7 +936,7 @@ export class PostgresClient {
935
936
  };
936
937
  await executeCall(call, options);
937
938
  if (resp === undefined) {
938
- throw new Error('API call completed without a result.');
939
+ throw new Error('operation completed without a result.');
939
940
  }
940
941
  return resp;
941
942
  }
@@ -947,7 +948,7 @@ export class PostgresClient {
947
948
  ): Promise<Project> {
948
949
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
949
950
  let resp: Project | undefined;
950
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
951
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
951
952
  const headers = new Headers();
952
953
  if (this.workspaceId !== undefined) {
953
954
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -963,7 +964,7 @@ export class PostgresClient {
963
964
  };
964
965
  await executeCall(call, options);
965
966
  if (resp === undefined) {
966
- throw new Error('API call completed without a result.');
967
+ throw new Error('operation completed without a result.');
967
968
  }
968
969
  return resp;
969
970
  }
@@ -972,7 +973,7 @@ export class PostgresClient {
972
973
  async getRole(req: GetRoleRequest, options?: CallOptions): Promise<Role> {
973
974
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
974
975
  let resp: Role | undefined;
975
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
976
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
976
977
  const headers = new Headers();
977
978
  if (this.workspaceId !== undefined) {
978
979
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -988,7 +989,7 @@ export class PostgresClient {
988
989
  };
989
990
  await executeCall(call, options);
990
991
  if (resp === undefined) {
991
- throw new Error('API call completed without a result.');
992
+ throw new Error('operation completed without a result.');
992
993
  }
993
994
  return resp;
994
995
  }
@@ -1000,7 +1001,7 @@ export class PostgresClient {
1000
1001
  ): Promise<SyncedTable> {
1001
1002
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
1002
1003
  let resp: SyncedTable | undefined;
1003
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1004
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1004
1005
  const headers = new Headers();
1005
1006
  if (this.workspaceId !== undefined) {
1006
1007
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1016,7 +1017,7 @@ export class PostgresClient {
1016
1017
  };
1017
1018
  await executeCall(call, options);
1018
1019
  if (resp === undefined) {
1019
- throw new Error('API call completed without a result.');
1020
+ throw new Error('operation completed without a result.');
1020
1021
  }
1021
1022
  return resp;
1022
1023
  }
@@ -1040,7 +1041,7 @@ export class PostgresClient {
1040
1041
  const query = params.toString();
1041
1042
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1042
1043
  let resp: ListBranchesResponse | undefined;
1043
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1044
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1044
1045
  const headers = new Headers();
1045
1046
  if (this.workspaceId !== undefined) {
1046
1047
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1056,7 +1057,7 @@ export class PostgresClient {
1056
1057
  };
1057
1058
  await executeCall(call, options);
1058
1059
  if (resp === undefined) {
1059
- throw new Error('API call completed without a result.');
1060
+ throw new Error('operation completed without a result.');
1060
1061
  }
1061
1062
  return resp;
1062
1063
  }
@@ -1094,7 +1095,7 @@ export class PostgresClient {
1094
1095
  const query = params.toString();
1095
1096
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1096
1097
  let resp: ListDatabasesResponse | undefined;
1097
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1098
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1098
1099
  const headers = new Headers();
1099
1100
  if (this.workspaceId !== undefined) {
1100
1101
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1110,7 +1111,7 @@ export class PostgresClient {
1110
1111
  };
1111
1112
  await executeCall(call, options);
1112
1113
  if (resp === undefined) {
1113
- throw new Error('API call completed without a result.');
1114
+ throw new Error('operation completed without a result.');
1114
1115
  }
1115
1116
  return resp;
1116
1117
  }
@@ -1148,7 +1149,7 @@ export class PostgresClient {
1148
1149
  const query = params.toString();
1149
1150
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1150
1151
  let resp: ListEndpointsResponse | undefined;
1151
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1152
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1152
1153
  const headers = new Headers();
1153
1154
  if (this.workspaceId !== undefined) {
1154
1155
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1164,7 +1165,7 @@ export class PostgresClient {
1164
1165
  };
1165
1166
  await executeCall(call, options);
1166
1167
  if (resp === undefined) {
1167
- throw new Error('API call completed without a result.');
1168
+ throw new Error('operation completed without a result.');
1168
1169
  }
1169
1170
  return resp;
1170
1171
  }
@@ -1205,7 +1206,7 @@ export class PostgresClient {
1205
1206
  const query = params.toString();
1206
1207
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1207
1208
  let resp: ListProjectsResponse | undefined;
1208
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1209
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1209
1210
  const headers = new Headers();
1210
1211
  if (this.workspaceId !== undefined) {
1211
1212
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1221,7 +1222,7 @@ export class PostgresClient {
1221
1222
  };
1222
1223
  await executeCall(call, options);
1223
1224
  if (resp === undefined) {
1224
- throw new Error('API call completed without a result.');
1225
+ throw new Error('operation completed without a result.');
1225
1226
  }
1226
1227
  return resp;
1227
1228
  }
@@ -1259,7 +1260,7 @@ export class PostgresClient {
1259
1260
  const query = params.toString();
1260
1261
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1261
1262
  let resp: ListRolesResponse | undefined;
1262
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1263
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1263
1264
  const headers = new Headers();
1264
1265
  if (this.workspaceId !== undefined) {
1265
1266
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1275,7 +1276,7 @@ export class PostgresClient {
1275
1276
  };
1276
1277
  await executeCall(call, options);
1277
1278
  if (resp === undefined) {
1278
- throw new Error('API call completed without a result.');
1279
+ throw new Error('operation completed without a result.');
1279
1280
  }
1280
1281
  return resp;
1281
1282
  }
@@ -1298,14 +1299,14 @@ export class PostgresClient {
1298
1299
  }
1299
1300
 
1300
1301
  /** Undeletes the specified database branch. */
1301
- async undeleteBranch(
1302
+ private async undeleteBranch(
1302
1303
  req: UndeleteBranchRequest,
1303
1304
  options?: CallOptions
1304
1305
  ): Promise<Operation> {
1305
1306
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}/undelete`;
1306
1307
  const body = marshalRequest(req, marshalUndeleteBranchRequestSchema);
1307
1308
  let resp: Operation | undefined;
1308
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1309
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1309
1310
  const headers = new Headers({'Content-Type': 'application/json'});
1310
1311
  if (this.workspaceId !== undefined) {
1311
1312
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1321,7 +1322,7 @@ export class PostgresClient {
1321
1322
  };
1322
1323
  await executeCall(call, options);
1323
1324
  if (resp === undefined) {
1324
- throw new Error('API call completed without a result.');
1325
+ throw new Error('operation completed without a result.');
1325
1326
  }
1326
1327
  return resp;
1327
1328
  }
@@ -1335,14 +1336,14 @@ export class PostgresClient {
1335
1336
  }
1336
1337
 
1337
1338
  /** Undeletes a soft-deleted project. */
1338
- async undeleteProject(
1339
+ private async undeleteProject(
1339
1340
  req: UndeleteProjectRequest,
1340
1341
  options?: CallOptions
1341
1342
  ): Promise<Operation> {
1342
1343
  const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}/undelete`;
1343
1344
  const body = marshalRequest(req, marshalUndeleteProjectRequestSchema);
1344
1345
  let resp: Operation | undefined;
1345
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1346
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1346
1347
  const headers = new Headers({'Content-Type': 'application/json'});
1347
1348
  if (this.workspaceId !== undefined) {
1348
1349
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1358,7 +1359,7 @@ export class PostgresClient {
1358
1359
  };
1359
1360
  await executeCall(call, options);
1360
1361
  if (resp === undefined) {
1361
- throw new Error('API call completed without a result.');
1362
+ throw new Error('operation completed without a result.');
1362
1363
  }
1363
1364
  return resp;
1364
1365
  }
@@ -1372,7 +1373,7 @@ export class PostgresClient {
1372
1373
  }
1373
1374
 
1374
1375
  /** Updates the specified database branch. You can set this branch as the project's default branch, or protect/unprotect it. */
1375
- async updateBranch(
1376
+ private async updateBranch(
1376
1377
  req: UpdateBranchRequest,
1377
1378
  options?: CallOptions
1378
1379
  ): Promise<Operation> {
@@ -1385,7 +1386,7 @@ export class PostgresClient {
1385
1386
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1386
1387
  const body = marshalRequest(req.branch, marshalBranchSchema);
1387
1388
  let resp: Operation | undefined;
1388
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1389
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1389
1390
  const headers = new Headers({'Content-Type': 'application/json'});
1390
1391
  if (this.workspaceId !== undefined) {
1391
1392
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1407,7 +1408,7 @@ export class PostgresClient {
1407
1408
  };
1408
1409
  await executeCall(call, options);
1409
1410
  if (resp === undefined) {
1410
- throw new Error('API call completed without a result.');
1411
+ throw new Error('operation completed without a result.');
1411
1412
  }
1412
1413
  return resp;
1413
1414
  }
@@ -1421,7 +1422,7 @@ export class PostgresClient {
1421
1422
  }
1422
1423
 
1423
1424
  /** Update a Database. */
1424
- async updateDatabase(
1425
+ private async updateDatabase(
1425
1426
  req: UpdateDatabaseRequest,
1426
1427
  options?: CallOptions
1427
1428
  ): Promise<Operation> {
@@ -1434,7 +1435,7 @@ export class PostgresClient {
1434
1435
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1435
1436
  const body = marshalRequest(req.database, marshalDatabaseSchema);
1436
1437
  let resp: Operation | undefined;
1437
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1438
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1438
1439
  const headers = new Headers({'Content-Type': 'application/json'});
1439
1440
  if (this.workspaceId !== undefined) {
1440
1441
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1456,7 +1457,7 @@ export class PostgresClient {
1456
1457
  };
1457
1458
  await executeCall(call, options);
1458
1459
  if (resp === undefined) {
1459
- throw new Error('API call completed without a result.');
1460
+ throw new Error('operation completed without a result.');
1460
1461
  }
1461
1462
  return resp;
1462
1463
  }
@@ -1470,7 +1471,7 @@ export class PostgresClient {
1470
1471
  }
1471
1472
 
1472
1473
  /** Updates the specified compute endpoint. You can update autoscaling limits, suspend timeout, or enable/disable the compute endpoint. */
1473
- async updateEndpoint(
1474
+ private async updateEndpoint(
1474
1475
  req: UpdateEndpointRequest,
1475
1476
  options?: CallOptions
1476
1477
  ): Promise<Operation> {
@@ -1483,7 +1484,7 @@ export class PostgresClient {
1483
1484
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1484
1485
  const body = marshalRequest(req.endpoint, marshalEndpointSchema);
1485
1486
  let resp: Operation | undefined;
1486
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1487
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1487
1488
  const headers = new Headers({'Content-Type': 'application/json'});
1488
1489
  if (this.workspaceId !== undefined) {
1489
1490
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1505,7 +1506,7 @@ export class PostgresClient {
1505
1506
  };
1506
1507
  await executeCall(call, options);
1507
1508
  if (resp === undefined) {
1508
- throw new Error('API call completed without a result.');
1509
+ throw new Error('operation completed without a result.');
1509
1510
  }
1510
1511
  return resp;
1511
1512
  }
@@ -1519,7 +1520,7 @@ export class PostgresClient {
1519
1520
  }
1520
1521
 
1521
1522
  /** Updates the specified database project. */
1522
- async updateProject(
1523
+ private async updateProject(
1523
1524
  req: UpdateProjectRequest,
1524
1525
  options?: CallOptions
1525
1526
  ): Promise<Operation> {
@@ -1532,7 +1533,7 @@ export class PostgresClient {
1532
1533
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1533
1534
  const body = marshalRequest(req.project, marshalProjectSchema);
1534
1535
  let resp: Operation | undefined;
1535
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1536
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1536
1537
  const headers = new Headers({'Content-Type': 'application/json'});
1537
1538
  if (this.workspaceId !== undefined) {
1538
1539
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1554,7 +1555,7 @@ export class PostgresClient {
1554
1555
  };
1555
1556
  await executeCall(call, options);
1556
1557
  if (resp === undefined) {
1557
- throw new Error('API call completed without a result.');
1558
+ throw new Error('operation completed without a result.');
1558
1559
  }
1559
1560
  return resp;
1560
1561
  }
@@ -1568,7 +1569,7 @@ export class PostgresClient {
1568
1569
  }
1569
1570
 
1570
1571
  /** Update a role for a branch. */
1571
- async updateRole(
1572
+ private async updateRole(
1572
1573
  req: UpdateRoleRequest,
1573
1574
  options?: CallOptions
1574
1575
  ): Promise<Operation> {
@@ -1581,7 +1582,7 @@ export class PostgresClient {
1581
1582
  const fullUrl = query !== '' ? `${url}?${query}` : url;
1582
1583
  const body = marshalRequest(req.role, marshalRoleSchema);
1583
1584
  let resp: Operation | undefined;
1584
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1585
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1585
1586
  const headers = new Headers({'Content-Type': 'application/json'});
1586
1587
  if (this.workspaceId !== undefined) {
1587
1588
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1603,7 +1604,7 @@ export class PostgresClient {
1603
1604
  };
1604
1605
  await executeCall(call, options);
1605
1606
  if (resp === undefined) {
1606
- throw new Error('API call completed without a result.');
1607
+ throw new Error('operation completed without a result.');
1607
1608
  }
1608
1609
  return resp;
1609
1610
  }
@@ -1645,23 +1646,22 @@ export class CreateBranchOperation {
1645
1646
  *
1646
1647
  * Throws if the operation failed.
1647
1648
  */
1648
- async wait(options?: CallOptions): Promise<Branch> {
1649
- const errStillRunning = new Error('operation still in progress');
1649
+ async wait(options?: LroOptions): Promise<Branch> {
1650
1650
  let result: Branch | undefined;
1651
1651
 
1652
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1652
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1653
1653
  const op = await this.client.getOperation(
1654
1654
  {
1655
1655
  name: this.operation.name,
1656
1656
  },
1657
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
1657
+ callSignal !== undefined ? {signal: callSignal} : undefined
1658
1658
  );
1659
1659
  this.operation = op;
1660
1660
  if (op.done === undefined) {
1661
1661
  throw new Error('operation is missing the done field');
1662
1662
  }
1663
1663
  if (!op.done) {
1664
- throw errStillRunning;
1664
+ throw new StillRunningError();
1665
1665
  }
1666
1666
 
1667
1667
  if (op.result?.$case === 'error') {
@@ -1684,16 +1684,9 @@ export class CreateBranchOperation {
1684
1684
  result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
1685
1685
  };
1686
1686
 
1687
- const retryOptions: CallOptions = {
1688
- ...(options?.signal !== undefined && {signal: options.signal}),
1689
- retrier: () =>
1690
- retryOn({}, (err: Error) => {
1691
- return err.message.includes('operation still in progress');
1692
- }),
1693
- };
1694
- await executeCall(call, retryOptions);
1687
+ await executeWait(call, options);
1695
1688
  if (result === undefined) {
1696
- throw new Error('API call completed without a result.');
1689
+ throw new Error('operation completed without a result.');
1697
1690
  }
1698
1691
  return result;
1699
1692
  }
@@ -1737,23 +1730,22 @@ export class CreateCatalogOperation {
1737
1730
  *
1738
1731
  * Throws if the operation failed.
1739
1732
  */
1740
- async wait(options?: CallOptions): Promise<Catalog> {
1741
- const errStillRunning = new Error('operation still in progress');
1733
+ async wait(options?: LroOptions): Promise<Catalog> {
1742
1734
  let result: Catalog | undefined;
1743
1735
 
1744
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1736
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1745
1737
  const op = await this.client.getOperation(
1746
1738
  {
1747
1739
  name: this.operation.name,
1748
1740
  },
1749
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
1741
+ callSignal !== undefined ? {signal: callSignal} : undefined
1750
1742
  );
1751
1743
  this.operation = op;
1752
1744
  if (op.done === undefined) {
1753
1745
  throw new Error('operation is missing the done field');
1754
1746
  }
1755
1747
  if (!op.done) {
1756
- throw errStillRunning;
1748
+ throw new StillRunningError();
1757
1749
  }
1758
1750
 
1759
1751
  if (op.result?.$case === 'error') {
@@ -1776,16 +1768,9 @@ export class CreateCatalogOperation {
1776
1768
  result = z.lazy(() => unmarshalCatalogSchema).parse(op.result.response);
1777
1769
  };
1778
1770
 
1779
- const retryOptions: CallOptions = {
1780
- ...(options?.signal !== undefined && {signal: options.signal}),
1781
- retrier: () =>
1782
- retryOn({}, (err: Error) => {
1783
- return err.message.includes('operation still in progress');
1784
- }),
1785
- };
1786
- await executeCall(call, retryOptions);
1771
+ await executeWait(call, options);
1787
1772
  if (result === undefined) {
1788
- throw new Error('API call completed without a result.');
1773
+ throw new Error('operation completed without a result.');
1789
1774
  }
1790
1775
  return result;
1791
1776
  }
@@ -1829,23 +1814,22 @@ export class CreateDatabaseOperation {
1829
1814
  *
1830
1815
  * Throws if the operation failed.
1831
1816
  */
1832
- async wait(options?: CallOptions): Promise<Database> {
1833
- const errStillRunning = new Error('operation still in progress');
1817
+ async wait(options?: LroOptions): Promise<Database> {
1834
1818
  let result: Database | undefined;
1835
1819
 
1836
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1820
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1837
1821
  const op = await this.client.getOperation(
1838
1822
  {
1839
1823
  name: this.operation.name,
1840
1824
  },
1841
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
1825
+ callSignal !== undefined ? {signal: callSignal} : undefined
1842
1826
  );
1843
1827
  this.operation = op;
1844
1828
  if (op.done === undefined) {
1845
1829
  throw new Error('operation is missing the done field');
1846
1830
  }
1847
1831
  if (!op.done) {
1848
- throw errStillRunning;
1832
+ throw new StillRunningError();
1849
1833
  }
1850
1834
 
1851
1835
  if (op.result?.$case === 'error') {
@@ -1868,16 +1852,9 @@ export class CreateDatabaseOperation {
1868
1852
  result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
1869
1853
  };
1870
1854
 
1871
- const retryOptions: CallOptions = {
1872
- ...(options?.signal !== undefined && {signal: options.signal}),
1873
- retrier: () =>
1874
- retryOn({}, (err: Error) => {
1875
- return err.message.includes('operation still in progress');
1876
- }),
1877
- };
1878
- await executeCall(call, retryOptions);
1855
+ await executeWait(call, options);
1879
1856
  if (result === undefined) {
1880
- throw new Error('API call completed without a result.');
1857
+ throw new Error('operation completed without a result.');
1881
1858
  }
1882
1859
  return result;
1883
1860
  }
@@ -1921,23 +1898,22 @@ export class CreateEndpointOperation {
1921
1898
  *
1922
1899
  * Throws if the operation failed.
1923
1900
  */
1924
- async wait(options?: CallOptions): Promise<Endpoint> {
1925
- const errStillRunning = new Error('operation still in progress');
1901
+ async wait(options?: LroOptions): Promise<Endpoint> {
1926
1902
  let result: Endpoint | undefined;
1927
1903
 
1928
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1904
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1929
1905
  const op = await this.client.getOperation(
1930
1906
  {
1931
1907
  name: this.operation.name,
1932
1908
  },
1933
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
1909
+ callSignal !== undefined ? {signal: callSignal} : undefined
1934
1910
  );
1935
1911
  this.operation = op;
1936
1912
  if (op.done === undefined) {
1937
1913
  throw new Error('operation is missing the done field');
1938
1914
  }
1939
1915
  if (!op.done) {
1940
- throw errStillRunning;
1916
+ throw new StillRunningError();
1941
1917
  }
1942
1918
 
1943
1919
  if (op.result?.$case === 'error') {
@@ -1960,16 +1936,9 @@ export class CreateEndpointOperation {
1960
1936
  result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
1961
1937
  };
1962
1938
 
1963
- const retryOptions: CallOptions = {
1964
- ...(options?.signal !== undefined && {signal: options.signal}),
1965
- retrier: () =>
1966
- retryOn({}, (err: Error) => {
1967
- return err.message.includes('operation still in progress');
1968
- }),
1969
- };
1970
- await executeCall(call, retryOptions);
1939
+ await executeWait(call, options);
1971
1940
  if (result === undefined) {
1972
- throw new Error('API call completed without a result.');
1941
+ throw new Error('operation completed without a result.');
1973
1942
  }
1974
1943
  return result;
1975
1944
  }
@@ -2013,23 +1982,22 @@ export class CreateProjectOperation {
2013
1982
  *
2014
1983
  * Throws if the operation failed.
2015
1984
  */
2016
- async wait(options?: CallOptions): Promise<Project> {
2017
- const errStillRunning = new Error('operation still in progress');
1985
+ async wait(options?: LroOptions): Promise<Project> {
2018
1986
  let result: Project | undefined;
2019
1987
 
2020
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1988
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2021
1989
  const op = await this.client.getOperation(
2022
1990
  {
2023
1991
  name: this.operation.name,
2024
1992
  },
2025
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
1993
+ callSignal !== undefined ? {signal: callSignal} : undefined
2026
1994
  );
2027
1995
  this.operation = op;
2028
1996
  if (op.done === undefined) {
2029
1997
  throw new Error('operation is missing the done field');
2030
1998
  }
2031
1999
  if (!op.done) {
2032
- throw errStillRunning;
2000
+ throw new StillRunningError();
2033
2001
  }
2034
2002
 
2035
2003
  if (op.result?.$case === 'error') {
@@ -2052,16 +2020,9 @@ export class CreateProjectOperation {
2052
2020
  result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
2053
2021
  };
2054
2022
 
2055
- const retryOptions: CallOptions = {
2056
- ...(options?.signal !== undefined && {signal: options.signal}),
2057
- retrier: () =>
2058
- retryOn({}, (err: Error) => {
2059
- return err.message.includes('operation still in progress');
2060
- }),
2061
- };
2062
- await executeCall(call, retryOptions);
2023
+ await executeWait(call, options);
2063
2024
  if (result === undefined) {
2064
- throw new Error('API call completed without a result.');
2025
+ throw new Error('operation completed without a result.');
2065
2026
  }
2066
2027
  return result;
2067
2028
  }
@@ -2105,23 +2066,22 @@ export class CreateRoleOperation {
2105
2066
  *
2106
2067
  * Throws if the operation failed.
2107
2068
  */
2108
- async wait(options?: CallOptions): Promise<Role> {
2109
- const errStillRunning = new Error('operation still in progress');
2069
+ async wait(options?: LroOptions): Promise<Role> {
2110
2070
  let result: Role | undefined;
2111
2071
 
2112
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2072
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2113
2073
  const op = await this.client.getOperation(
2114
2074
  {
2115
2075
  name: this.operation.name,
2116
2076
  },
2117
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2077
+ callSignal !== undefined ? {signal: callSignal} : undefined
2118
2078
  );
2119
2079
  this.operation = op;
2120
2080
  if (op.done === undefined) {
2121
2081
  throw new Error('operation is missing the done field');
2122
2082
  }
2123
2083
  if (!op.done) {
2124
- throw errStillRunning;
2084
+ throw new StillRunningError();
2125
2085
  }
2126
2086
 
2127
2087
  if (op.result?.$case === 'error') {
@@ -2144,16 +2104,9 @@ export class CreateRoleOperation {
2144
2104
  result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
2145
2105
  };
2146
2106
 
2147
- const retryOptions: CallOptions = {
2148
- ...(options?.signal !== undefined && {signal: options.signal}),
2149
- retrier: () =>
2150
- retryOn({}, (err: Error) => {
2151
- return err.message.includes('operation still in progress');
2152
- }),
2153
- };
2154
- await executeCall(call, retryOptions);
2107
+ await executeWait(call, options);
2155
2108
  if (result === undefined) {
2156
- throw new Error('API call completed without a result.');
2109
+ throw new Error('operation completed without a result.');
2157
2110
  }
2158
2111
  return result;
2159
2112
  }
@@ -2197,23 +2150,22 @@ export class CreateSyncedTableOperation {
2197
2150
  *
2198
2151
  * Throws if the operation failed.
2199
2152
  */
2200
- async wait(options?: CallOptions): Promise<SyncedTable> {
2201
- const errStillRunning = new Error('operation still in progress');
2153
+ async wait(options?: LroOptions): Promise<SyncedTable> {
2202
2154
  let result: SyncedTable | undefined;
2203
2155
 
2204
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2156
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2205
2157
  const op = await this.client.getOperation(
2206
2158
  {
2207
2159
  name: this.operation.name,
2208
2160
  },
2209
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2161
+ callSignal !== undefined ? {signal: callSignal} : undefined
2210
2162
  );
2211
2163
  this.operation = op;
2212
2164
  if (op.done === undefined) {
2213
2165
  throw new Error('operation is missing the done field');
2214
2166
  }
2215
2167
  if (!op.done) {
2216
- throw errStillRunning;
2168
+ throw new StillRunningError();
2217
2169
  }
2218
2170
 
2219
2171
  if (op.result?.$case === 'error') {
@@ -2238,16 +2190,9 @@ export class CreateSyncedTableOperation {
2238
2190
  .parse(op.result.response);
2239
2191
  };
2240
2192
 
2241
- const retryOptions: CallOptions = {
2242
- ...(options?.signal !== undefined && {signal: options.signal}),
2243
- retrier: () =>
2244
- retryOn({}, (err: Error) => {
2245
- return err.message.includes('operation still in progress');
2246
- }),
2247
- };
2248
- await executeCall(call, retryOptions);
2193
+ await executeWait(call, options);
2249
2194
  if (result === undefined) {
2250
- throw new Error('API call completed without a result.');
2195
+ throw new Error('operation completed without a result.');
2251
2196
  }
2252
2197
  return result;
2253
2198
  }
@@ -2291,22 +2236,20 @@ export class DeleteBranchOperation {
2291
2236
  *
2292
2237
  * Throws if the operation failed.
2293
2238
  */
2294
- async wait(options?: CallOptions): Promise<void> {
2295
- const errStillRunning = new Error('operation still in progress');
2296
-
2297
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2239
+ async wait(options?: LroOptions): Promise<void> {
2240
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2298
2241
  const op = await this.client.getOperation(
2299
2242
  {
2300
2243
  name: this.operation.name,
2301
2244
  },
2302
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2245
+ callSignal !== undefined ? {signal: callSignal} : undefined
2303
2246
  );
2304
2247
  this.operation = op;
2305
2248
  if (op.done === undefined) {
2306
2249
  throw new Error('operation is missing the done field');
2307
2250
  }
2308
2251
  if (!op.done) {
2309
- throw errStillRunning;
2252
+ throw new StillRunningError();
2310
2253
  }
2311
2254
 
2312
2255
  if (op.result?.$case === 'error') {
@@ -2323,14 +2266,7 @@ export class DeleteBranchOperation {
2323
2266
  }
2324
2267
  };
2325
2268
 
2326
- const retryOptions: CallOptions = {
2327
- ...(options?.signal !== undefined && {signal: options.signal}),
2328
- retrier: () =>
2329
- retryOn({}, (err: Error) => {
2330
- return err.message.includes('operation still in progress');
2331
- }),
2332
- };
2333
- await executeCall(call, retryOptions);
2269
+ await executeWait(call, options);
2334
2270
  }
2335
2271
 
2336
2272
  /** Checks whether the operation has completed */
@@ -2372,22 +2308,20 @@ export class DeleteCatalogOperation {
2372
2308
  *
2373
2309
  * Throws if the operation failed.
2374
2310
  */
2375
- async wait(options?: CallOptions): Promise<void> {
2376
- const errStillRunning = new Error('operation still in progress');
2377
-
2378
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2311
+ async wait(options?: LroOptions): Promise<void> {
2312
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2379
2313
  const op = await this.client.getOperation(
2380
2314
  {
2381
2315
  name: this.operation.name,
2382
2316
  },
2383
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2317
+ callSignal !== undefined ? {signal: callSignal} : undefined
2384
2318
  );
2385
2319
  this.operation = op;
2386
2320
  if (op.done === undefined) {
2387
2321
  throw new Error('operation is missing the done field');
2388
2322
  }
2389
2323
  if (!op.done) {
2390
- throw errStillRunning;
2324
+ throw new StillRunningError();
2391
2325
  }
2392
2326
 
2393
2327
  if (op.result?.$case === 'error') {
@@ -2404,14 +2338,7 @@ export class DeleteCatalogOperation {
2404
2338
  }
2405
2339
  };
2406
2340
 
2407
- const retryOptions: CallOptions = {
2408
- ...(options?.signal !== undefined && {signal: options.signal}),
2409
- retrier: () =>
2410
- retryOn({}, (err: Error) => {
2411
- return err.message.includes('operation still in progress');
2412
- }),
2413
- };
2414
- await executeCall(call, retryOptions);
2341
+ await executeWait(call, options);
2415
2342
  }
2416
2343
 
2417
2344
  /** Checks whether the operation has completed */
@@ -2453,22 +2380,20 @@ export class DeleteDatabaseOperation {
2453
2380
  *
2454
2381
  * Throws if the operation failed.
2455
2382
  */
2456
- async wait(options?: CallOptions): Promise<void> {
2457
- const errStillRunning = new Error('operation still in progress');
2458
-
2459
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2383
+ async wait(options?: LroOptions): Promise<void> {
2384
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2460
2385
  const op = await this.client.getOperation(
2461
2386
  {
2462
2387
  name: this.operation.name,
2463
2388
  },
2464
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2389
+ callSignal !== undefined ? {signal: callSignal} : undefined
2465
2390
  );
2466
2391
  this.operation = op;
2467
2392
  if (op.done === undefined) {
2468
2393
  throw new Error('operation is missing the done field');
2469
2394
  }
2470
2395
  if (!op.done) {
2471
- throw errStillRunning;
2396
+ throw new StillRunningError();
2472
2397
  }
2473
2398
 
2474
2399
  if (op.result?.$case === 'error') {
@@ -2485,14 +2410,7 @@ export class DeleteDatabaseOperation {
2485
2410
  }
2486
2411
  };
2487
2412
 
2488
- const retryOptions: CallOptions = {
2489
- ...(options?.signal !== undefined && {signal: options.signal}),
2490
- retrier: () =>
2491
- retryOn({}, (err: Error) => {
2492
- return err.message.includes('operation still in progress');
2493
- }),
2494
- };
2495
- await executeCall(call, retryOptions);
2413
+ await executeWait(call, options);
2496
2414
  }
2497
2415
 
2498
2416
  /** Checks whether the operation has completed */
@@ -2534,22 +2452,20 @@ export class DeleteEndpointOperation {
2534
2452
  *
2535
2453
  * Throws if the operation failed.
2536
2454
  */
2537
- async wait(options?: CallOptions): Promise<void> {
2538
- const errStillRunning = new Error('operation still in progress');
2539
-
2540
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2455
+ async wait(options?: LroOptions): Promise<void> {
2456
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2541
2457
  const op = await this.client.getOperation(
2542
2458
  {
2543
2459
  name: this.operation.name,
2544
2460
  },
2545
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2461
+ callSignal !== undefined ? {signal: callSignal} : undefined
2546
2462
  );
2547
2463
  this.operation = op;
2548
2464
  if (op.done === undefined) {
2549
2465
  throw new Error('operation is missing the done field');
2550
2466
  }
2551
2467
  if (!op.done) {
2552
- throw errStillRunning;
2468
+ throw new StillRunningError();
2553
2469
  }
2554
2470
 
2555
2471
  if (op.result?.$case === 'error') {
@@ -2566,14 +2482,7 @@ export class DeleteEndpointOperation {
2566
2482
  }
2567
2483
  };
2568
2484
 
2569
- const retryOptions: CallOptions = {
2570
- ...(options?.signal !== undefined && {signal: options.signal}),
2571
- retrier: () =>
2572
- retryOn({}, (err: Error) => {
2573
- return err.message.includes('operation still in progress');
2574
- }),
2575
- };
2576
- await executeCall(call, retryOptions);
2485
+ await executeWait(call, options);
2577
2486
  }
2578
2487
 
2579
2488
  /** Checks whether the operation has completed */
@@ -2615,22 +2524,20 @@ export class DeleteProjectOperation {
2615
2524
  *
2616
2525
  * Throws if the operation failed.
2617
2526
  */
2618
- async wait(options?: CallOptions): Promise<void> {
2619
- const errStillRunning = new Error('operation still in progress');
2620
-
2621
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2527
+ async wait(options?: LroOptions): Promise<void> {
2528
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2622
2529
  const op = await this.client.getOperation(
2623
2530
  {
2624
2531
  name: this.operation.name,
2625
2532
  },
2626
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2533
+ callSignal !== undefined ? {signal: callSignal} : undefined
2627
2534
  );
2628
2535
  this.operation = op;
2629
2536
  if (op.done === undefined) {
2630
2537
  throw new Error('operation is missing the done field');
2631
2538
  }
2632
2539
  if (!op.done) {
2633
- throw errStillRunning;
2540
+ throw new StillRunningError();
2634
2541
  }
2635
2542
 
2636
2543
  if (op.result?.$case === 'error') {
@@ -2647,14 +2554,7 @@ export class DeleteProjectOperation {
2647
2554
  }
2648
2555
  };
2649
2556
 
2650
- const retryOptions: CallOptions = {
2651
- ...(options?.signal !== undefined && {signal: options.signal}),
2652
- retrier: () =>
2653
- retryOn({}, (err: Error) => {
2654
- return err.message.includes('operation still in progress');
2655
- }),
2656
- };
2657
- await executeCall(call, retryOptions);
2557
+ await executeWait(call, options);
2658
2558
  }
2659
2559
 
2660
2560
  /** Checks whether the operation has completed */
@@ -2696,22 +2596,20 @@ export class DeleteRoleOperation {
2696
2596
  *
2697
2597
  * Throws if the operation failed.
2698
2598
  */
2699
- async wait(options?: CallOptions): Promise<void> {
2700
- const errStillRunning = new Error('operation still in progress');
2701
-
2702
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2599
+ async wait(options?: LroOptions): Promise<void> {
2600
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2703
2601
  const op = await this.client.getOperation(
2704
2602
  {
2705
2603
  name: this.operation.name,
2706
2604
  },
2707
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2605
+ callSignal !== undefined ? {signal: callSignal} : undefined
2708
2606
  );
2709
2607
  this.operation = op;
2710
2608
  if (op.done === undefined) {
2711
2609
  throw new Error('operation is missing the done field');
2712
2610
  }
2713
2611
  if (!op.done) {
2714
- throw errStillRunning;
2612
+ throw new StillRunningError();
2715
2613
  }
2716
2614
 
2717
2615
  if (op.result?.$case === 'error') {
@@ -2728,14 +2626,7 @@ export class DeleteRoleOperation {
2728
2626
  }
2729
2627
  };
2730
2628
 
2731
- const retryOptions: CallOptions = {
2732
- ...(options?.signal !== undefined && {signal: options.signal}),
2733
- retrier: () =>
2734
- retryOn({}, (err: Error) => {
2735
- return err.message.includes('operation still in progress');
2736
- }),
2737
- };
2738
- await executeCall(call, retryOptions);
2629
+ await executeWait(call, options);
2739
2630
  }
2740
2631
 
2741
2632
  /** Checks whether the operation has completed */
@@ -2777,22 +2668,20 @@ export class DeleteSyncedTableOperation {
2777
2668
  *
2778
2669
  * Throws if the operation failed.
2779
2670
  */
2780
- async wait(options?: CallOptions): Promise<void> {
2781
- const errStillRunning = new Error('operation still in progress');
2782
-
2783
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2671
+ async wait(options?: LroOptions): Promise<void> {
2672
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2784
2673
  const op = await this.client.getOperation(
2785
2674
  {
2786
2675
  name: this.operation.name,
2787
2676
  },
2788
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2677
+ callSignal !== undefined ? {signal: callSignal} : undefined
2789
2678
  );
2790
2679
  this.operation = op;
2791
2680
  if (op.done === undefined) {
2792
2681
  throw new Error('operation is missing the done field');
2793
2682
  }
2794
2683
  if (!op.done) {
2795
- throw errStillRunning;
2684
+ throw new StillRunningError();
2796
2685
  }
2797
2686
 
2798
2687
  if (op.result?.$case === 'error') {
@@ -2809,14 +2698,7 @@ export class DeleteSyncedTableOperation {
2809
2698
  }
2810
2699
  };
2811
2700
 
2812
- const retryOptions: CallOptions = {
2813
- ...(options?.signal !== undefined && {signal: options.signal}),
2814
- retrier: () =>
2815
- retryOn({}, (err: Error) => {
2816
- return err.message.includes('operation still in progress');
2817
- }),
2818
- };
2819
- await executeCall(call, retryOptions);
2701
+ await executeWait(call, options);
2820
2702
  }
2821
2703
 
2822
2704
  /** Checks whether the operation has completed */
@@ -2858,22 +2740,20 @@ export class UndeleteBranchOperation {
2858
2740
  *
2859
2741
  * Throws if the operation failed.
2860
2742
  */
2861
- async wait(options?: CallOptions): Promise<void> {
2862
- const errStillRunning = new Error('operation still in progress');
2863
-
2864
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2743
+ async wait(options?: LroOptions): Promise<void> {
2744
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2865
2745
  const op = await this.client.getOperation(
2866
2746
  {
2867
2747
  name: this.operation.name,
2868
2748
  },
2869
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2749
+ callSignal !== undefined ? {signal: callSignal} : undefined
2870
2750
  );
2871
2751
  this.operation = op;
2872
2752
  if (op.done === undefined) {
2873
2753
  throw new Error('operation is missing the done field');
2874
2754
  }
2875
2755
  if (!op.done) {
2876
- throw errStillRunning;
2756
+ throw new StillRunningError();
2877
2757
  }
2878
2758
 
2879
2759
  if (op.result?.$case === 'error') {
@@ -2890,14 +2770,7 @@ export class UndeleteBranchOperation {
2890
2770
  }
2891
2771
  };
2892
2772
 
2893
- const retryOptions: CallOptions = {
2894
- ...(options?.signal !== undefined && {signal: options.signal}),
2895
- retrier: () =>
2896
- retryOn({}, (err: Error) => {
2897
- return err.message.includes('operation still in progress');
2898
- }),
2899
- };
2900
- await executeCall(call, retryOptions);
2773
+ await executeWait(call, options);
2901
2774
  }
2902
2775
 
2903
2776
  /** Checks whether the operation has completed */
@@ -2939,22 +2812,20 @@ export class UndeleteProjectOperation {
2939
2812
  *
2940
2813
  * Throws if the operation failed.
2941
2814
  */
2942
- async wait(options?: CallOptions): Promise<void> {
2943
- const errStillRunning = new Error('operation still in progress');
2944
-
2945
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2815
+ async wait(options?: LroOptions): Promise<void> {
2816
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
2946
2817
  const op = await this.client.getOperation(
2947
2818
  {
2948
2819
  name: this.operation.name,
2949
2820
  },
2950
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2821
+ callSignal !== undefined ? {signal: callSignal} : undefined
2951
2822
  );
2952
2823
  this.operation = op;
2953
2824
  if (op.done === undefined) {
2954
2825
  throw new Error('operation is missing the done field');
2955
2826
  }
2956
2827
  if (!op.done) {
2957
- throw errStillRunning;
2828
+ throw new StillRunningError();
2958
2829
  }
2959
2830
 
2960
2831
  if (op.result?.$case === 'error') {
@@ -2971,14 +2842,7 @@ export class UndeleteProjectOperation {
2971
2842
  }
2972
2843
  };
2973
2844
 
2974
- const retryOptions: CallOptions = {
2975
- ...(options?.signal !== undefined && {signal: options.signal}),
2976
- retrier: () =>
2977
- retryOn({}, (err: Error) => {
2978
- return err.message.includes('operation still in progress');
2979
- }),
2980
- };
2981
- await executeCall(call, retryOptions);
2845
+ await executeWait(call, options);
2982
2846
  }
2983
2847
 
2984
2848
  /** Checks whether the operation has completed */
@@ -3020,23 +2884,22 @@ export class UpdateBranchOperation {
3020
2884
  *
3021
2885
  * Throws if the operation failed.
3022
2886
  */
3023
- async wait(options?: CallOptions): Promise<Branch> {
3024
- const errStillRunning = new Error('operation still in progress');
2887
+ async wait(options?: LroOptions): Promise<Branch> {
3025
2888
  let result: Branch | undefined;
3026
2889
 
3027
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2890
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
3028
2891
  const op = await this.client.getOperation(
3029
2892
  {
3030
2893
  name: this.operation.name,
3031
2894
  },
3032
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2895
+ callSignal !== undefined ? {signal: callSignal} : undefined
3033
2896
  );
3034
2897
  this.operation = op;
3035
2898
  if (op.done === undefined) {
3036
2899
  throw new Error('operation is missing the done field');
3037
2900
  }
3038
2901
  if (!op.done) {
3039
- throw errStillRunning;
2902
+ throw new StillRunningError();
3040
2903
  }
3041
2904
 
3042
2905
  if (op.result?.$case === 'error') {
@@ -3059,16 +2922,9 @@ export class UpdateBranchOperation {
3059
2922
  result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
3060
2923
  };
3061
2924
 
3062
- const retryOptions: CallOptions = {
3063
- ...(options?.signal !== undefined && {signal: options.signal}),
3064
- retrier: () =>
3065
- retryOn({}, (err: Error) => {
3066
- return err.message.includes('operation still in progress');
3067
- }),
3068
- };
3069
- await executeCall(call, retryOptions);
2925
+ await executeWait(call, options);
3070
2926
  if (result === undefined) {
3071
- throw new Error('API call completed without a result.');
2927
+ throw new Error('operation completed without a result.');
3072
2928
  }
3073
2929
  return result;
3074
2930
  }
@@ -3112,23 +2968,22 @@ export class UpdateDatabaseOperation {
3112
2968
  *
3113
2969
  * Throws if the operation failed.
3114
2970
  */
3115
- async wait(options?: CallOptions): Promise<Database> {
3116
- const errStillRunning = new Error('operation still in progress');
2971
+ async wait(options?: LroOptions): Promise<Database> {
3117
2972
  let result: Database | undefined;
3118
2973
 
3119
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
2974
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
3120
2975
  const op = await this.client.getOperation(
3121
2976
  {
3122
2977
  name: this.operation.name,
3123
2978
  },
3124
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
2979
+ callSignal !== undefined ? {signal: callSignal} : undefined
3125
2980
  );
3126
2981
  this.operation = op;
3127
2982
  if (op.done === undefined) {
3128
2983
  throw new Error('operation is missing the done field');
3129
2984
  }
3130
2985
  if (!op.done) {
3131
- throw errStillRunning;
2986
+ throw new StillRunningError();
3132
2987
  }
3133
2988
 
3134
2989
  if (op.result?.$case === 'error') {
@@ -3151,16 +3006,9 @@ export class UpdateDatabaseOperation {
3151
3006
  result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
3152
3007
  };
3153
3008
 
3154
- const retryOptions: CallOptions = {
3155
- ...(options?.signal !== undefined && {signal: options.signal}),
3156
- retrier: () =>
3157
- retryOn({}, (err: Error) => {
3158
- return err.message.includes('operation still in progress');
3159
- }),
3160
- };
3161
- await executeCall(call, retryOptions);
3009
+ await executeWait(call, options);
3162
3010
  if (result === undefined) {
3163
- throw new Error('API call completed without a result.');
3011
+ throw new Error('operation completed without a result.');
3164
3012
  }
3165
3013
  return result;
3166
3014
  }
@@ -3204,23 +3052,22 @@ export class UpdateEndpointOperation {
3204
3052
  *
3205
3053
  * Throws if the operation failed.
3206
3054
  */
3207
- async wait(options?: CallOptions): Promise<Endpoint> {
3208
- const errStillRunning = new Error('operation still in progress');
3055
+ async wait(options?: LroOptions): Promise<Endpoint> {
3209
3056
  let result: Endpoint | undefined;
3210
3057
 
3211
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
3058
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
3212
3059
  const op = await this.client.getOperation(
3213
3060
  {
3214
3061
  name: this.operation.name,
3215
3062
  },
3216
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
3063
+ callSignal !== undefined ? {signal: callSignal} : undefined
3217
3064
  );
3218
3065
  this.operation = op;
3219
3066
  if (op.done === undefined) {
3220
3067
  throw new Error('operation is missing the done field');
3221
3068
  }
3222
3069
  if (!op.done) {
3223
- throw errStillRunning;
3070
+ throw new StillRunningError();
3224
3071
  }
3225
3072
 
3226
3073
  if (op.result?.$case === 'error') {
@@ -3243,16 +3090,9 @@ export class UpdateEndpointOperation {
3243
3090
  result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
3244
3091
  };
3245
3092
 
3246
- const retryOptions: CallOptions = {
3247
- ...(options?.signal !== undefined && {signal: options.signal}),
3248
- retrier: () =>
3249
- retryOn({}, (err: Error) => {
3250
- return err.message.includes('operation still in progress');
3251
- }),
3252
- };
3253
- await executeCall(call, retryOptions);
3093
+ await executeWait(call, options);
3254
3094
  if (result === undefined) {
3255
- throw new Error('API call completed without a result.');
3095
+ throw new Error('operation completed without a result.');
3256
3096
  }
3257
3097
  return result;
3258
3098
  }
@@ -3296,23 +3136,22 @@ export class UpdateProjectOperation {
3296
3136
  *
3297
3137
  * Throws if the operation failed.
3298
3138
  */
3299
- async wait(options?: CallOptions): Promise<Project> {
3300
- const errStillRunning = new Error('operation still in progress');
3139
+ async wait(options?: LroOptions): Promise<Project> {
3301
3140
  let result: Project | undefined;
3302
3141
 
3303
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
3142
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
3304
3143
  const op = await this.client.getOperation(
3305
3144
  {
3306
3145
  name: this.operation.name,
3307
3146
  },
3308
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
3147
+ callSignal !== undefined ? {signal: callSignal} : undefined
3309
3148
  );
3310
3149
  this.operation = op;
3311
3150
  if (op.done === undefined) {
3312
3151
  throw new Error('operation is missing the done field');
3313
3152
  }
3314
3153
  if (!op.done) {
3315
- throw errStillRunning;
3154
+ throw new StillRunningError();
3316
3155
  }
3317
3156
 
3318
3157
  if (op.result?.$case === 'error') {
@@ -3335,16 +3174,9 @@ export class UpdateProjectOperation {
3335
3174
  result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
3336
3175
  };
3337
3176
 
3338
- const retryOptions: CallOptions = {
3339
- ...(options?.signal !== undefined && {signal: options.signal}),
3340
- retrier: () =>
3341
- retryOn({}, (err: Error) => {
3342
- return err.message.includes('operation still in progress');
3343
- }),
3344
- };
3345
- await executeCall(call, retryOptions);
3177
+ await executeWait(call, options);
3346
3178
  if (result === undefined) {
3347
- throw new Error('API call completed without a result.');
3179
+ throw new Error('operation completed without a result.');
3348
3180
  }
3349
3181
  return result;
3350
3182
  }
@@ -3388,23 +3220,22 @@ export class UpdateRoleOperation {
3388
3220
  *
3389
3221
  * Throws if the operation failed.
3390
3222
  */
3391
- async wait(options?: CallOptions): Promise<Role> {
3392
- const errStillRunning = new Error('operation still in progress');
3223
+ async wait(options?: LroOptions): Promise<Role> {
3393
3224
  let result: Role | undefined;
3394
3225
 
3395
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
3226
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
3396
3227
  const op = await this.client.getOperation(
3397
3228
  {
3398
3229
  name: this.operation.name,
3399
3230
  },
3400
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
3231
+ callSignal !== undefined ? {signal: callSignal} : undefined
3401
3232
  );
3402
3233
  this.operation = op;
3403
3234
  if (op.done === undefined) {
3404
3235
  throw new Error('operation is missing the done field');
3405
3236
  }
3406
3237
  if (!op.done) {
3407
- throw errStillRunning;
3238
+ throw new StillRunningError();
3408
3239
  }
3409
3240
 
3410
3241
  if (op.result?.$case === 'error') {
@@ -3427,16 +3258,9 @@ export class UpdateRoleOperation {
3427
3258
  result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
3428
3259
  };
3429
3260
 
3430
- const retryOptions: CallOptions = {
3431
- ...(options?.signal !== undefined && {signal: options.signal}),
3432
- retrier: () =>
3433
- retryOn({}, (err: Error) => {
3434
- return err.message.includes('operation still in progress');
3435
- }),
3436
- };
3437
- await executeCall(call, retryOptions);
3261
+ await executeWait(call, options);
3438
3262
  if (result === undefined) {
3439
- throw new Error('API call completed without a result.');
3263
+ throw new Error('operation completed without a result.');
3440
3264
  }
3441
3265
  return result;
3442
3266
  }