Skip to content

Commit 5bccec1

Browse files
committed
Regenerate clients with two-step LRO start/poll JSDoc
## Summary Regenerates the `apps`, `environments`, and `postgres` clients to pick up the new long-running-operation JSDoc emitted by the genkit generator. The generated surface is otherwise unchanged. ## Why Bug-bash testers found the LRO call pattern confusing: `await client.createXOperation(req)` returns a handle and `await op.wait()` polls it to completion, but the generated `createXOperation` factory method had no JSDoc, so the two-step relationship was invisible at the call site and `op.wait(undefined)` looked mandatory. The `wait()` signature was already `wait(options?: LroOptions)`, so a no-argument `op.wait()` already compiled — only the discoverability was missing. ## What changed ### Interface changes None. No signatures change; `wait()` was already `wait(options?: LroOptions)`. ### Behavioral changes None. This is a docs-only regeneration. Each `createXOperation` / `deleteXOperation` / `updateXOperation` / `undeleteXOperation` factory now carries a concise JSDoc describing the start/poll pattern with a no-argument `await op.wait()` example, and each `wait()` JSDoc notes that `options` is optional. ### Internal changes Regenerated `packages/{apps,environments,postgres}/src/v1/client.ts` from the shared descriptor. Pairs with the universe genkit generator change in `openapi/genkit/codegen/sdkjs/method.go` (`lroTmpl` and `waitMethodTmpl`); the JSDoc text lives in that template, not hand-written here. ## How is this tested? `npm run build`, `npm run lint`, `npm run typecheck`, and `npm run format:check` all pass across the workspace; `npm test` for `@databricks/sdk-core` passes (357 tests). The generated packages have no test suites of their own. Co-authored-by: Isaac
1 parent 4680f01 commit 5bccec1

3 files changed

Lines changed: 297 additions & 81 deletions

File tree

packages/apps/src/v1/client.ts

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ export class AppsClient {
314314
return resp;
315315
}
316316

317+
/**
318+
* Starts the operation and returns a handle to it. Call `wait()` on the
319+
* returned handle to poll until the operation completes.
320+
*
321+
* @example
322+
* const op = await client.createSpaceOperation(req);
323+
* const result = await op.wait();
324+
*/
317325
async createSpaceOperation(
318326
req: CreateSpaceRequest,
319327
options?: CallOptions
@@ -425,6 +433,14 @@ export class AppsClient {
425433
return resp;
426434
}
427435

436+
/**
437+
* Starts the operation and returns a handle to it. Call `wait()` on the
438+
* returned handle to poll until the operation completes.
439+
*
440+
* @example
441+
* const op = await client.deleteSpaceOperation(req);
442+
* const result = await op.wait();
443+
*/
428444
async deleteSpaceOperation(
429445
req: DeleteSpaceRequest,
430446
options?: CallOptions
@@ -1022,6 +1038,14 @@ export class AppsClient {
10221038
return resp;
10231039
}
10241040

1041+
/**
1042+
* Starts the operation and returns a handle to it. Call `wait()` on the
1043+
* returned handle to poll until the operation completes.
1044+
*
1045+
* @example
1046+
* const op = await client.updateSpaceOperation(req);
1047+
* const result = await op.wait();
1048+
*/
10251049
async updateSpaceOperation(
10261050
req: UpdateSpaceRequest,
10271051
options?: CallOptions
@@ -1053,9 +1077,9 @@ export class CreateSpaceOperation {
10531077
}
10541078

10551079
/**
1056-
* Polls the operation until it completes.
1057-
*
1058-
* Throws if the operation failed.
1080+
* Polls the operation until it completes and returns the result. Throws if the
1081+
* operation failed. `options` is optional; call `wait()` to poll with the
1082+
* defaults.
10591083
*/
10601084
async wait(options?: LroOptions): Promise<Space> {
10611085
let result: Space | undefined;
@@ -1135,9 +1159,9 @@ export class DeleteSpaceOperation {
11351159
}
11361160

11371161
/**
1138-
* Polls the operation until it completes.
1139-
*
1140-
* Throws if the operation failed.
1162+
* Polls the operation until it completes and returns the result. Throws if the
1163+
* operation failed. `options` is optional; call `wait()` to poll with the
1164+
* defaults.
11411165
*/
11421166
async wait(options?: LroOptions): Promise<void> {
11431167
const call = async (callSignal?: AbortSignal): Promise<void> => {
@@ -1205,9 +1229,9 @@ export class UpdateSpaceOperation {
12051229
}
12061230

12071231
/**
1208-
* Polls the operation until it completes.
1209-
*
1210-
* Throws if the operation failed.
1232+
* Polls the operation until it completes and returns the result. Throws if the
1233+
* operation failed. `options` is optional; call `wait()` to poll with the
1234+
* defaults.
12111235
*/
12121236
async wait(options?: LroOptions): Promise<Space> {
12131237
let result: Space | undefined;

packages/environments/src/v1/client.ts

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ export class EnvironmentsClient {
136136
return resp;
137137
}
138138

139+
/**
140+
* Starts the operation and returns a handle to it. Call `wait()` on the
141+
* returned handle to poll until the operation completes.
142+
*
143+
* @example
144+
* const op = await client.createWorkspaceBaseEnvironmentOperation(req);
145+
* const result = await op.wait();
146+
*/
139147
async createWorkspaceBaseEnvironmentOperation(
140148
req: CreateWorkspaceBaseEnvironmentRequest,
141149
options?: CallOptions
@@ -372,6 +380,14 @@ export class EnvironmentsClient {
372380
return resp;
373381
}
374382

383+
/**
384+
* Starts the operation and returns a handle to it. Call `wait()` on the
385+
* returned handle to poll until the operation completes.
386+
*
387+
* @example
388+
* const op = await client.refreshWorkspaceBaseEnvironmentOperation(req);
389+
* const result = await op.wait();
390+
*/
375391
async refreshWorkspaceBaseEnvironmentOperation(
376392
req: RefreshWorkspaceBaseEnvironmentRequest,
377393
options?: CallOptions
@@ -467,6 +483,14 @@ export class EnvironmentsClient {
467483
return resp;
468484
}
469485

486+
/**
487+
* Starts the operation and returns a handle to it. Call `wait()` on the
488+
* returned handle to poll until the operation completes.
489+
*
490+
* @example
491+
* const op = await client.updateWorkspaceBaseEnvironmentOperation(req);
492+
* const result = await op.wait();
493+
*/
470494
async updateWorkspaceBaseEnvironmentOperation(
471495
req: UpdateWorkspaceBaseEnvironmentRequest,
472496
options?: CallOptions
@@ -500,9 +524,9 @@ export class CreateWorkspaceBaseEnvironmentOperation {
500524
}
501525

502526
/**
503-
* Polls the operation until it completes.
504-
*
505-
* Throws if the operation failed.
527+
* Polls the operation until it completes and returns the result. Throws if the
528+
* operation failed. `options` is optional; call `wait()` to poll with the
529+
* defaults.
506530
*/
507531
async wait(options?: LroOptions): Promise<WorkspaceBaseEnvironment> {
508532
let result: WorkspaceBaseEnvironment | undefined;
@@ -586,9 +610,9 @@ export class RefreshWorkspaceBaseEnvironmentOperation {
586610
}
587611

588612
/**
589-
* Polls the operation until it completes.
590-
*
591-
* Throws if the operation failed.
613+
* Polls the operation until it completes and returns the result. Throws if the
614+
* operation failed. `options` is optional; call `wait()` to poll with the
615+
* defaults.
592616
*/
593617
async wait(options?: LroOptions): Promise<WorkspaceBaseEnvironment> {
594618
let result: WorkspaceBaseEnvironment | undefined;
@@ -672,9 +696,9 @@ export class UpdateWorkspaceBaseEnvironmentOperation {
672696
}
673697

674698
/**
675-
* Polls the operation until it completes.
676-
*
677-
* Throws if the operation failed.
699+
* Polls the operation until it completes and returns the result. Throws if the
700+
* operation failed. `options` is optional; call `wait()` to poll with the
701+
* defaults.
678702
*/
679703
async wait(options?: LroOptions): Promise<WorkspaceBaseEnvironment> {
680704
let result: WorkspaceBaseEnvironment | undefined;

0 commit comments

Comments
 (0)