@databricks/sdk-pipelines 0.1.0-dev.3 → 0.1.0-dev.5

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/v2/client.ts DELETED
@@ -1,630 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
4
- import {createDefault} from '@databricks/sdk-core/clientinfo';
5
- import type {Logger} from '@databricks/sdk-core/logger';
6
- import {NoOpLogger} from '@databricks/sdk-core/logger';
7
- import type {CallOptions} from '@databricks/sdk-options/call';
8
- import type {ClientOptions} from '@databricks/sdk-options/client';
9
- import type {LroOptions} from '@databricks/sdk-options/lro';
10
- import type {HttpClient} from '@databricks/sdk-core/http';
11
- import {newHttpClient} from './transport';
12
- import {
13
- buildHttpRequest,
14
- executeCall,
15
- executeHttpCall,
16
- marshalRequest,
17
- parseResponse,
18
- executeWait,
19
- StillRunningError,
20
- } from './utils';
21
- import pkgJson from '../../package.json' with {type: 'json'};
22
- import type {
23
- ApplyEnvironmentRequest,
24
- ApplyEnvironmentResponse,
25
- ClonePipelineRequest,
26
- ClonePipelineResponse,
27
- CreatePipelineRequest,
28
- CreatePipelineResponse,
29
- DeletePipelineRequest,
30
- DeletePipelineResponse,
31
- EditPipelineRequest,
32
- EditPipelineResponse,
33
- GetPipelineRequest,
34
- GetPipelineResponse,
35
- GetUpdateRequest,
36
- GetUpdateResponse,
37
- ListPipelineEventsRequest,
38
- ListPipelineEventsResponse,
39
- ListPipelinesRequest,
40
- ListPipelinesResponse,
41
- ListUpdatesRequest,
42
- ListUpdatesResponse,
43
- PipelineEvent,
44
- PipelineStateInfo,
45
- StartUpdateRequest,
46
- StartUpdateResponse,
47
- StopPipelineRequest,
48
- StopPipelineResponse,
49
- } from './model';
50
- import {
51
- PipelineState_PipelineState,
52
- marshalApplyEnvironmentRequestSchema,
53
- marshalClonePipelineRequestSchema,
54
- marshalCreatePipelineRequestSchema,
55
- marshalEditPipelineRequestSchema,
56
- marshalStartUpdateRequestSchema,
57
- marshalStopPipelineRequestSchema,
58
- unmarshalApplyEnvironmentResponseSchema,
59
- unmarshalClonePipelineResponseSchema,
60
- unmarshalCreatePipelineResponseSchema,
61
- unmarshalDeletePipelineResponseSchema,
62
- unmarshalEditPipelineResponseSchema,
63
- unmarshalGetPipelineResponseSchema,
64
- unmarshalGetUpdateResponseSchema,
65
- unmarshalListPipelineEventsResponseSchema,
66
- unmarshalListPipelinesResponseSchema,
67
- unmarshalListUpdatesResponseSchema,
68
- unmarshalStartUpdateResponseSchema,
69
- unmarshalStopPipelineResponseSchema,
70
- } from './model';
71
-
72
- // Package identity segment for this client to be used in the User-Agent header.
73
- const PACKAGE_SEGMENT = {
74
- key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
75
- value: pkgJson.version,
76
- };
77
-
78
- export class PipelinesClient {
79
- private readonly host: string;
80
- // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
81
- // When set, workspace-level methods send X-Databricks-Org-Id on every
82
- // request.
83
- private readonly workspaceId: string | undefined;
84
- private readonly httpClient: HttpClient;
85
- private readonly logger: Logger;
86
- // User-Agent header value. Composed once at construction from
87
- // createDefault() merged with this package's identity and the active
88
- // credential's name.
89
- private readonly userAgent: string;
90
-
91
- constructor(options: ClientOptions) {
92
- if (options.host === undefined) {
93
- throw new Error('Host is required.');
94
- }
95
- this.host = options.host.replace(/\/$/, '');
96
- this.workspaceId = options.workspaceId;
97
- this.logger = options.logger ?? new NoOpLogger();
98
- const info = createDefault()
99
- .with(PACKAGE_SEGMENT)
100
- .with({key: 'sdk-js-auth', value: AUTH_VERSION})
101
- .with({key: 'auth', value: options.credentials?.name() ?? 'default'});
102
- this.userAgent = info.toString();
103
- this.httpClient = newHttpClient(options);
104
- }
105
-
106
- /**
107
- * *
108
- * Applies the current pipeline environment onto the pipeline compute. The environment applied can be used by subsequent
109
- * dev-mode updates.
110
- */
111
- async applyEnvironment(
112
- req: ApplyEnvironmentRequest,
113
- options?: CallOptions
114
- ): Promise<ApplyEnvironmentResponse> {
115
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/environment/apply`;
116
- const body = marshalRequest(req, marshalApplyEnvironmentRequestSchema);
117
- let resp: ApplyEnvironmentResponse | undefined;
118
- const call = async (callSignal?: AbortSignal): Promise<void> => {
119
- const headers = new Headers({'Content-Type': 'application/json'});
120
- if (this.workspaceId !== undefined) {
121
- headers.set('X-Databricks-Org-Id', this.workspaceId);
122
- }
123
- headers.set('User-Agent', this.userAgent);
124
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
125
- const respBody = await executeHttpCall({
126
- request: httpReq,
127
- httpClient: this.httpClient,
128
- logger: this.logger,
129
- });
130
- resp = parseResponse(respBody, unmarshalApplyEnvironmentResponseSchema);
131
- };
132
- await executeCall(call, options);
133
- if (resp === undefined) {
134
- throw new Error('operation completed without a result.');
135
- }
136
- return resp;
137
- }
138
-
139
- /**
140
- * Creates a new pipeline using Unity Catalog from a pipeline using Hive Metastore.
141
- * This method returns the ID of the newly created clone.
142
- * Additionally, this method starts an update for the newly created pipeline.
143
- */
144
- async clone(
145
- req: ClonePipelineRequest,
146
- options?: CallOptions
147
- ): Promise<ClonePipelineResponse> {
148
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/clone`;
149
- const body = marshalRequest(req, marshalClonePipelineRequestSchema);
150
- let resp: ClonePipelineResponse | undefined;
151
- const call = async (callSignal?: AbortSignal): Promise<void> => {
152
- const headers = new Headers({'Content-Type': 'application/json'});
153
- if (this.workspaceId !== undefined) {
154
- headers.set('X-Databricks-Org-Id', this.workspaceId);
155
- }
156
- headers.set('User-Agent', this.userAgent);
157
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
158
- const respBody = await executeHttpCall({
159
- request: httpReq,
160
- httpClient: this.httpClient,
161
- logger: this.logger,
162
- });
163
- resp = parseResponse(respBody, unmarshalClonePipelineResponseSchema);
164
- };
165
- await executeCall(call, options);
166
- if (resp === undefined) {
167
- throw new Error('operation completed without a result.');
168
- }
169
- return resp;
170
- }
171
-
172
- /**
173
- * Creates a new data processing pipeline based on the requested configuration. If successful, this method returns
174
- * the ID of the new pipeline.
175
- */
176
- async create(
177
- req: CreatePipelineRequest,
178
- options?: CallOptions
179
- ): Promise<CreatePipelineResponse> {
180
- const url = `${this.host}/api/2.0/pipelines`;
181
- const body = marshalRequest(req, marshalCreatePipelineRequestSchema);
182
- let resp: CreatePipelineResponse | undefined;
183
- const call = async (callSignal?: AbortSignal): Promise<void> => {
184
- const headers = new Headers({'Content-Type': 'application/json'});
185
- if (this.workspaceId !== undefined) {
186
- headers.set('X-Databricks-Org-Id', this.workspaceId);
187
- }
188
- headers.set('User-Agent', this.userAgent);
189
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
190
- const respBody = await executeHttpCall({
191
- request: httpReq,
192
- httpClient: this.httpClient,
193
- logger: this.logger,
194
- });
195
- resp = parseResponse(respBody, unmarshalCreatePipelineResponseSchema);
196
- };
197
- await executeCall(call, options);
198
- if (resp === undefined) {
199
- throw new Error('operation completed without a result.');
200
- }
201
- return resp;
202
- }
203
-
204
- /**
205
- * Deletes a pipeline. If the pipeline publishes to Unity Catalog, pipeline deletion will cascade to
206
- * all pipeline tables. Please reach out to <Databricks> support for assistance to undo this action.
207
- */
208
- async delete(
209
- req: DeletePipelineRequest,
210
- options?: CallOptions
211
- ): Promise<DeletePipelineResponse> {
212
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}`;
213
- const params = new URLSearchParams();
214
- if (req.force !== undefined) {
215
- params.append('force', String(req.force));
216
- }
217
- if (req.cascade !== undefined) {
218
- params.append('cascade', String(req.cascade));
219
- }
220
- const query = params.toString();
221
- const fullUrl = query !== '' ? `${url}?${query}` : url;
222
- let resp: DeletePipelineResponse | undefined;
223
- const call = async (callSignal?: AbortSignal): Promise<void> => {
224
- const headers = new Headers();
225
- if (this.workspaceId !== undefined) {
226
- headers.set('X-Databricks-Org-Id', this.workspaceId);
227
- }
228
- headers.set('User-Agent', this.userAgent);
229
- const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
230
- const respBody = await executeHttpCall({
231
- request: httpReq,
232
- httpClient: this.httpClient,
233
- logger: this.logger,
234
- });
235
- resp = parseResponse(respBody, unmarshalDeletePipelineResponseSchema);
236
- };
237
- await executeCall(call, options);
238
- if (resp === undefined) {
239
- throw new Error('operation completed without a result.');
240
- }
241
- return resp;
242
- }
243
-
244
- /** Updates a pipeline with the supplied configuration. */
245
- async edit(
246
- req: EditPipelineRequest,
247
- options?: CallOptions
248
- ): Promise<EditPipelineResponse> {
249
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}`;
250
- const body = marshalRequest(req, marshalEditPipelineRequestSchema);
251
- let resp: EditPipelineResponse | undefined;
252
- const call = async (callSignal?: AbortSignal): Promise<void> => {
253
- const headers = new Headers({'Content-Type': 'application/json'});
254
- if (this.workspaceId !== undefined) {
255
- headers.set('X-Databricks-Org-Id', this.workspaceId);
256
- }
257
- headers.set('User-Agent', this.userAgent);
258
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
259
- const respBody = await executeHttpCall({
260
- request: httpReq,
261
- httpClient: this.httpClient,
262
- logger: this.logger,
263
- });
264
- resp = parseResponse(respBody, unmarshalEditPipelineResponseSchema);
265
- };
266
- await executeCall(call, options);
267
- if (resp === undefined) {
268
- throw new Error('operation completed without a result.');
269
- }
270
- return resp;
271
- }
272
-
273
- /** Retrieves events for a pipeline. */
274
- async events(
275
- req: ListPipelineEventsRequest,
276
- options?: CallOptions
277
- ): Promise<ListPipelineEventsResponse> {
278
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/events`;
279
- const params = new URLSearchParams();
280
- if (req.pageToken !== undefined) {
281
- params.append('page_token', req.pageToken);
282
- }
283
- if (req.maxResults !== undefined) {
284
- params.append('max_results', String(req.maxResults));
285
- }
286
- if (req.orderBy !== undefined) {
287
- params.append('order_by', String(req.orderBy));
288
- }
289
- if (req.filter !== undefined) {
290
- params.append('filter', req.filter);
291
- }
292
- const query = params.toString();
293
- const fullUrl = query !== '' ? `${url}?${query}` : url;
294
- let resp: ListPipelineEventsResponse | undefined;
295
- const call = async (callSignal?: AbortSignal): Promise<void> => {
296
- const headers = new Headers();
297
- if (this.workspaceId !== undefined) {
298
- headers.set('X-Databricks-Org-Id', this.workspaceId);
299
- }
300
- headers.set('User-Agent', this.userAgent);
301
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
302
- const respBody = await executeHttpCall({
303
- request: httpReq,
304
- httpClient: this.httpClient,
305
- logger: this.logger,
306
- });
307
- resp = parseResponse(respBody, unmarshalListPipelineEventsResponseSchema);
308
- };
309
- await executeCall(call, options);
310
- if (resp === undefined) {
311
- throw new Error('operation completed without a result.');
312
- }
313
- return resp;
314
- }
315
-
316
- async *eventsIter(
317
- req: ListPipelineEventsRequest,
318
- options?: CallOptions
319
- ): AsyncGenerator<PipelineEvent> {
320
- const pageReq: ListPipelineEventsRequest = {...req};
321
- for (;;) {
322
- const resp = await this.events(pageReq, options);
323
- for (const item of resp.events ?? []) {
324
- yield item;
325
- }
326
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
327
- return;
328
- }
329
- pageReq.pageToken = resp.nextPageToken;
330
- }
331
- }
332
-
333
- /** Get a pipeline. */
334
- async get(
335
- req: GetPipelineRequest,
336
- options?: CallOptions
337
- ): Promise<GetPipelineResponse> {
338
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}`;
339
- let resp: GetPipelineResponse | undefined;
340
- const call = async (callSignal?: AbortSignal): Promise<void> => {
341
- const headers = new Headers();
342
- if (this.workspaceId !== undefined) {
343
- headers.set('X-Databricks-Org-Id', this.workspaceId);
344
- }
345
- headers.set('User-Agent', this.userAgent);
346
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
347
- const respBody = await executeHttpCall({
348
- request: httpReq,
349
- httpClient: this.httpClient,
350
- logger: this.logger,
351
- });
352
- resp = parseResponse(respBody, unmarshalGetPipelineResponseSchema);
353
- };
354
- await executeCall(call, options);
355
- if (resp === undefined) {
356
- throw new Error('operation completed without a result.');
357
- }
358
- return resp;
359
- }
360
-
361
- /** Gets an update from an active pipeline. */
362
- async getUpdate(
363
- req: GetUpdateRequest,
364
- options?: CallOptions
365
- ): Promise<GetUpdateResponse> {
366
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/updates/${req.updateId ?? ''}`;
367
- let resp: GetUpdateResponse | undefined;
368
- const call = async (callSignal?: AbortSignal): Promise<void> => {
369
- const headers = new Headers();
370
- if (this.workspaceId !== undefined) {
371
- headers.set('X-Databricks-Org-Id', this.workspaceId);
372
- }
373
- headers.set('User-Agent', this.userAgent);
374
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
375
- const respBody = await executeHttpCall({
376
- request: httpReq,
377
- httpClient: this.httpClient,
378
- logger: this.logger,
379
- });
380
- resp = parseResponse(respBody, unmarshalGetUpdateResponseSchema);
381
- };
382
- await executeCall(call, options);
383
- if (resp === undefined) {
384
- throw new Error('operation completed without a result.');
385
- }
386
- return resp;
387
- }
388
-
389
- /** Lists pipelines defined in the Spark Declarative Pipelines system. */
390
- async list(
391
- req: ListPipelinesRequest,
392
- options?: CallOptions
393
- ): Promise<ListPipelinesResponse> {
394
- const url = `${this.host}/api/2.0/pipelines`;
395
- const params = new URLSearchParams();
396
- if (req.pageToken !== undefined) {
397
- params.append('page_token', req.pageToken);
398
- }
399
- if (req.maxResults !== undefined) {
400
- params.append('max_results', String(req.maxResults));
401
- }
402
- if (req.orderBy !== undefined) {
403
- params.append('order_by', String(req.orderBy));
404
- }
405
- if (req.filter !== undefined) {
406
- params.append('filter', req.filter);
407
- }
408
- const query = params.toString();
409
- const fullUrl = query !== '' ? `${url}?${query}` : url;
410
- let resp: ListPipelinesResponse | undefined;
411
- const call = async (callSignal?: AbortSignal): Promise<void> => {
412
- const headers = new Headers();
413
- if (this.workspaceId !== undefined) {
414
- headers.set('X-Databricks-Org-Id', this.workspaceId);
415
- }
416
- headers.set('User-Agent', this.userAgent);
417
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
418
- const respBody = await executeHttpCall({
419
- request: httpReq,
420
- httpClient: this.httpClient,
421
- logger: this.logger,
422
- });
423
- resp = parseResponse(respBody, unmarshalListPipelinesResponseSchema);
424
- };
425
- await executeCall(call, options);
426
- if (resp === undefined) {
427
- throw new Error('operation completed without a result.');
428
- }
429
- return resp;
430
- }
431
-
432
- async *listIter(
433
- req: ListPipelinesRequest,
434
- options?: CallOptions
435
- ): AsyncGenerator<PipelineStateInfo> {
436
- const pageReq: ListPipelinesRequest = {...req};
437
- for (;;) {
438
- const resp = await this.list(pageReq, options);
439
- for (const item of resp.statuses ?? []) {
440
- yield item;
441
- }
442
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
443
- return;
444
- }
445
- pageReq.pageToken = resp.nextPageToken;
446
- }
447
- }
448
-
449
- /** List updates for an active pipeline. */
450
- async listUpdates(
451
- req: ListUpdatesRequest,
452
- options?: CallOptions
453
- ): Promise<ListUpdatesResponse> {
454
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/updates`;
455
- const params = new URLSearchParams();
456
- if (req.pageToken !== undefined) {
457
- params.append('page_token', req.pageToken);
458
- }
459
- if (req.maxResults !== undefined) {
460
- params.append('max_results', String(req.maxResults));
461
- }
462
- if (req.untilUpdateId !== undefined) {
463
- params.append('until_update_id', req.untilUpdateId);
464
- }
465
- const query = params.toString();
466
- const fullUrl = query !== '' ? `${url}?${query}` : url;
467
- let resp: ListUpdatesResponse | undefined;
468
- const call = async (callSignal?: AbortSignal): Promise<void> => {
469
- const headers = new Headers();
470
- if (this.workspaceId !== undefined) {
471
- headers.set('X-Databricks-Org-Id', this.workspaceId);
472
- }
473
- headers.set('User-Agent', this.userAgent);
474
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
475
- const respBody = await executeHttpCall({
476
- request: httpReq,
477
- httpClient: this.httpClient,
478
- logger: this.logger,
479
- });
480
- resp = parseResponse(respBody, unmarshalListUpdatesResponseSchema);
481
- };
482
- await executeCall(call, options);
483
- if (resp === undefined) {
484
- throw new Error('operation completed without a result.');
485
- }
486
- return resp;
487
- }
488
-
489
- /** Starts a new update for the pipeline. If there is already an active update for the pipeline, the request will fail and the active update will remain running. */
490
- async start(
491
- req: StartUpdateRequest,
492
- options?: CallOptions
493
- ): Promise<StartUpdateResponse> {
494
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/updates`;
495
- const body = marshalRequest(req, marshalStartUpdateRequestSchema);
496
- let resp: StartUpdateResponse | undefined;
497
- const call = async (callSignal?: AbortSignal): Promise<void> => {
498
- const headers = new Headers({'Content-Type': 'application/json'});
499
- if (this.workspaceId !== undefined) {
500
- headers.set('X-Databricks-Org-Id', this.workspaceId);
501
- }
502
- headers.set('User-Agent', this.userAgent);
503
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
504
- const respBody = await executeHttpCall({
505
- request: httpReq,
506
- httpClient: this.httpClient,
507
- logger: this.logger,
508
- });
509
- resp = parseResponse(respBody, unmarshalStartUpdateResponseSchema);
510
- };
511
- await executeCall(call, options);
512
- if (resp === undefined) {
513
- throw new Error('operation completed without a result.');
514
- }
515
- return resp;
516
- }
517
-
518
- /** Stops the pipeline by canceling the active update. If there is no active update for the pipeline, this request is a no-op. */
519
- private async stop(
520
- req: StopPipelineRequest,
521
- options?: CallOptions
522
- ): Promise<StopPipelineResponse> {
523
- const url = `${this.host}/api/2.0/pipelines/${req.pipelineId ?? ''}/stop`;
524
- const body = marshalRequest(req, marshalStopPipelineRequestSchema);
525
- let resp: StopPipelineResponse | undefined;
526
- const call = async (callSignal?: AbortSignal): Promise<void> => {
527
- const headers = new Headers({'Content-Type': 'application/json'});
528
- if (this.workspaceId !== undefined) {
529
- headers.set('X-Databricks-Org-Id', this.workspaceId);
530
- }
531
- headers.set('User-Agent', this.userAgent);
532
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
533
- const respBody = await executeHttpCall({
534
- request: httpReq,
535
- httpClient: this.httpClient,
536
- logger: this.logger,
537
- });
538
- resp = parseResponse(respBody, unmarshalStopPipelineResponseSchema);
539
- };
540
- await executeCall(call, options);
541
- if (resp === undefined) {
542
- throw new Error('operation completed without a result.');
543
- }
544
- return resp;
545
- }
546
-
547
- async stopWaiter(
548
- req: StopPipelineRequest,
549
- options?: CallOptions
550
- ): Promise<StopWaiter> {
551
- await this.stop(req, options);
552
- if (req.pipelineId === undefined) {
553
- throw new Error(
554
- 'request field pipelineId required for polling is missing'
555
- );
556
- }
557
- return new StopWaiter(this, req.pipelineId);
558
- }
559
- }
560
-
561
- export class StopWaiter {
562
- constructor(
563
- private readonly client: PipelinesClient,
564
- readonly pipelineId: string
565
- ) {}
566
-
567
- /**
568
- * Polls until the operation reaches a terminal state.
569
- *
570
- * Throws if a failure state is reached.
571
- */
572
- async wait(options?: LroOptions): Promise<GetPipelineResponse> {
573
- let result: GetPipelineResponse | undefined;
574
-
575
- const call = async (callSignal?: AbortSignal): Promise<void> => {
576
- const pollResp = await this.client.get(
577
- {
578
- pipelineId: this.pipelineId,
579
- },
580
- callSignal !== undefined ? {signal: callSignal} : undefined
581
- );
582
-
583
- const status = pollResp.state;
584
- if (status === undefined) {
585
- throw new Error('response missing required status field');
586
- }
587
-
588
- switch (status) {
589
- case PipelineState_PipelineState.IDLE:
590
- result = pollResp;
591
- return;
592
- case PipelineState_PipelineState.FAILED: {
593
- const msg = pollResp.cause ?? '(no message)';
594
- throw new Error(`terminal state ${status}: ${msg}`);
595
- }
596
- default:
597
- throw new StillRunningError();
598
- }
599
- };
600
-
601
- await executeWait(call, options);
602
- if (result === undefined) {
603
- throw new Error('operation completed without a result.');
604
- }
605
- return result;
606
- }
607
-
608
- /** Checks whether the operation has reached a terminal state. */
609
- async done(options?: CallOptions): Promise<boolean> {
610
- const pollResp = await this.client.get(
611
- {
612
- pipelineId: this.pipelineId,
613
- },
614
- options
615
- );
616
-
617
- const status = pollResp.state;
618
- if (status === undefined) {
619
- throw new Error('response missing required status field');
620
- }
621
-
622
- switch (status) {
623
- case PipelineState_PipelineState.IDLE:
624
- case PipelineState_PipelineState.FAILED:
625
- return true;
626
- default:
627
- return false;
628
- }
629
- }
630
- }