@databricks/sdk-modelserving 0.1.0-dev.1 → 0.1.0-dev.3

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 {
@@ -17,13 +16,15 @@ import {
17
16
  sendAndCheckError,
18
17
  marshalRequest,
19
18
  parseResponse,
19
+ executeWait,
20
+ StillRunningError,
20
21
  } from './utils';
21
22
  import pkgJson from '../../package.json' with {type: 'json'};
22
23
  import type {
23
24
  CreateInferenceEndpointRequest,
24
25
  CreatePtEndpointRequest,
25
26
  DeleteInferenceEndpointRequest,
26
- DeleteInferenceEndpointRequest_Response,
27
+ DeleteInferenceEndpointResponse,
27
28
  ExportMetricsResponse,
28
29
  ExternalFunctionRequest,
29
30
  ExternalFunctionResponse,
@@ -32,22 +33,22 @@ import type {
32
33
  GetInferenceEndpointSchemaRequest,
33
34
  GetOpenApiResponse,
34
35
  GetServedModelBuildLogsRequest,
35
- GetServedModelBuildLogsRequest_Response,
36
+ GetServedModelBuildLogsResponse,
36
37
  GetServedModelLogsRequest,
37
- GetServedModelLogsRequest_Response,
38
+ GetServedModelLogsResponse,
38
39
  InferenceEndpointDetailed,
39
40
  ListInferenceEndpointsRequest,
40
- ListInferenceEndpointsRequest_Response,
41
+ ListInferenceEndpointsResponse,
41
42
  PatchInferenceEndpointTagsRequest,
42
- PatchInferenceEndpointTagsRequest_Response,
43
+ PatchInferenceEndpointTagsResponse,
43
44
  PutInferenceEndpointAiGatewayRequest,
44
- PutInferenceEndpointAiGatewayRequest_Response,
45
+ PutInferenceEndpointAiGatewayResponse,
45
46
  PutInferenceEndpointConfigRequest,
46
47
  PutInferenceEndpointRateLimitsRequest,
47
- PutInferenceEndpointRateLimitsRequest_Response,
48
+ PutInferenceEndpointRateLimitsResponse,
48
49
  PutPtEndpointConfigRequest,
49
50
  UpdateInferenceEndpointNotificationsRequest,
50
- UpdateInferenceEndpointNotificationsRequest_Response,
51
+ UpdateInferenceEndpointNotificationsResponse,
51
52
  } from './model';
52
53
  import {
53
54
  InferenceEndpointState_ConfigUpdateState,
@@ -60,15 +61,15 @@ import {
60
61
  marshalPutInferenceEndpointRateLimitsRequestSchema,
61
62
  marshalPutPtEndpointConfigRequestSchema,
62
63
  marshalUpdateInferenceEndpointNotificationsRequestSchema,
63
- unmarshalDeleteInferenceEndpointRequest_ResponseSchema,
64
- unmarshalGetServedModelBuildLogsRequest_ResponseSchema,
65
- unmarshalGetServedModelLogsRequest_ResponseSchema,
64
+ unmarshalDeleteInferenceEndpointResponseSchema,
65
+ unmarshalGetServedModelBuildLogsResponseSchema,
66
+ unmarshalGetServedModelLogsResponseSchema,
66
67
  unmarshalInferenceEndpointDetailedSchema,
67
- unmarshalListInferenceEndpointsRequest_ResponseSchema,
68
- unmarshalPatchInferenceEndpointTagsRequest_ResponseSchema,
69
- unmarshalPutInferenceEndpointAiGatewayRequest_ResponseSchema,
70
- unmarshalPutInferenceEndpointRateLimitsRequest_ResponseSchema,
71
- unmarshalUpdateInferenceEndpointNotificationsRequest_ResponseSchema,
68
+ unmarshalListInferenceEndpointsResponseSchema,
69
+ unmarshalPatchInferenceEndpointTagsResponseSchema,
70
+ unmarshalPutInferenceEndpointAiGatewayResponseSchema,
71
+ unmarshalPutInferenceEndpointRateLimitsResponseSchema,
72
+ unmarshalUpdateInferenceEndpointNotificationsResponseSchema,
72
73
  } from './model';
73
74
 
74
75
  // Package identity segment for this client to be used in the User-Agent header.
@@ -77,9 +78,7 @@ const PACKAGE_SEGMENT = {
77
78
  value: pkgJson.version,
78
79
  };
79
80
 
80
- class StillRunningError extends Error {}
81
-
82
- export class ModelservingClient {
81
+ export class ModelServingClient {
83
82
  private readonly host: string;
84
83
  // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
85
84
  // When set, workspace-level methods send X-Databricks-Org-Id on every
@@ -108,7 +107,7 @@ export class ModelservingClient {
108
107
  }
109
108
 
110
109
  /** Create a new serving endpoint. */
111
- async createInferenceEndpoint(
110
+ private async createInferenceEndpoint(
112
111
  req: CreateInferenceEndpointRequest,
113
112
  options?: CallOptions
114
113
  ): Promise<InferenceEndpointDetailed> {
@@ -118,7 +117,7 @@ export class ModelservingClient {
118
117
  marshalCreateInferenceEndpointRequestSchema
119
118
  );
120
119
  let resp: InferenceEndpointDetailed | undefined;
121
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
120
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
122
121
  const headers = new Headers({'Content-Type': 'application/json'});
123
122
  if (this.workspaceId !== undefined) {
124
123
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -134,7 +133,7 @@ export class ModelservingClient {
134
133
  };
135
134
  await executeCall(call, options);
136
135
  if (resp === undefined) {
137
- throw new Error('API call completed without a result.');
136
+ throw new Error('operation completed without a result.');
138
137
  }
139
138
  return resp;
140
139
  }
@@ -151,14 +150,14 @@ export class ModelservingClient {
151
150
  }
152
151
 
153
152
  /** Create a new PT serving endpoint. */
154
- async createProvisionedThroughputInferenceEndpoint(
153
+ private async createProvisionedThroughputInferenceEndpoint(
155
154
  req: CreatePtEndpointRequest,
156
155
  options?: CallOptions
157
156
  ): Promise<InferenceEndpointDetailed> {
158
157
  const url = `${this.host}/api/2.0/serving-endpoints/pt`;
159
158
  const body = marshalRequest(req, marshalCreatePtEndpointRequestSchema);
160
159
  let resp: InferenceEndpointDetailed | undefined;
161
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
160
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
162
161
  const headers = new Headers({'Content-Type': 'application/json'});
163
162
  if (this.workspaceId !== undefined) {
164
163
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -174,7 +173,7 @@ export class ModelservingClient {
174
173
  };
175
174
  await executeCall(call, options);
176
175
  if (resp === undefined) {
177
- throw new Error('API call completed without a result.');
176
+ throw new Error('operation completed without a result.');
178
177
  }
179
178
  return resp;
180
179
  }
@@ -197,10 +196,10 @@ export class ModelservingClient {
197
196
  async deleteInferenceEndpoint(
198
197
  req: DeleteInferenceEndpointRequest,
199
198
  options?: CallOptions
200
- ): Promise<DeleteInferenceEndpointRequest_Response> {
199
+ ): Promise<DeleteInferenceEndpointResponse> {
201
200
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}`;
202
- let resp: DeleteInferenceEndpointRequest_Response | undefined;
203
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
201
+ let resp: DeleteInferenceEndpointResponse | undefined;
202
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
204
203
  const headers = new Headers();
205
204
  if (this.workspaceId !== undefined) {
206
205
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -214,12 +213,12 @@ export class ModelservingClient {
214
213
  });
215
214
  resp = parseResponse(
216
215
  respBody,
217
- unmarshalDeleteInferenceEndpointRequest_ResponseSchema
216
+ unmarshalDeleteInferenceEndpointResponseSchema
218
217
  );
219
218
  };
220
219
  await executeCall(call, options);
221
220
  if (resp === undefined) {
222
- throw new Error('API call completed without a result.');
221
+ throw new Error('operation completed without a result.');
223
222
  }
224
223
  return resp;
225
224
  }
@@ -231,7 +230,7 @@ export class ModelservingClient {
231
230
  ): Promise<ExportMetricsResponse> {
232
231
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/metrics`;
233
232
  let resp: ExportMetricsResponse | undefined;
234
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
233
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
235
234
  const headers = new Headers();
236
235
  if (this.workspaceId !== undefined) {
237
236
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -249,7 +248,7 @@ export class ModelservingClient {
249
248
  };
250
249
  await executeCall(call, options);
251
250
  if (resp === undefined) {
252
- throw new Error('API call completed without a result.');
251
+ throw new Error('operation completed without a result.');
253
252
  }
254
253
  return resp;
255
254
  }
@@ -261,7 +260,7 @@ export class ModelservingClient {
261
260
  ): Promise<InferenceEndpointDetailed> {
262
261
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}`;
263
262
  let resp: InferenceEndpointDetailed | undefined;
264
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
263
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
265
264
  const headers = new Headers();
266
265
  if (this.workspaceId !== undefined) {
267
266
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -277,7 +276,7 @@ export class ModelservingClient {
277
276
  };
278
277
  await executeCall(call, options);
279
278
  if (resp === undefined) {
280
- throw new Error('API call completed without a result.');
279
+ throw new Error('operation completed without a result.');
281
280
  }
282
281
  return resp;
283
282
  }
@@ -289,7 +288,7 @@ export class ModelservingClient {
289
288
  ): Promise<GetOpenApiResponse> {
290
289
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/openapi`;
291
290
  let resp: GetOpenApiResponse | undefined;
292
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
291
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
293
292
  const headers = new Headers();
294
293
  if (this.workspaceId !== undefined) {
295
294
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -307,7 +306,7 @@ export class ModelservingClient {
307
306
  };
308
307
  await executeCall(call, options);
309
308
  if (resp === undefined) {
310
- throw new Error('API call completed without a result.');
309
+ throw new Error('operation completed without a result.');
311
310
  }
312
311
  return resp;
313
312
  }
@@ -316,10 +315,10 @@ export class ModelservingClient {
316
315
  async getServedModelBuildLogs(
317
316
  req: GetServedModelBuildLogsRequest,
318
317
  options?: CallOptions
319
- ): Promise<GetServedModelBuildLogsRequest_Response> {
318
+ ): Promise<GetServedModelBuildLogsResponse> {
320
319
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/served-models/${req.servedModelName ?? ''}/build-logs`;
321
- let resp: GetServedModelBuildLogsRequest_Response | undefined;
322
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
320
+ let resp: GetServedModelBuildLogsResponse | undefined;
321
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
323
322
  const headers = new Headers();
324
323
  if (this.workspaceId !== undefined) {
325
324
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -333,12 +332,12 @@ export class ModelservingClient {
333
332
  });
334
333
  resp = parseResponse(
335
334
  respBody,
336
- unmarshalGetServedModelBuildLogsRequest_ResponseSchema
335
+ unmarshalGetServedModelBuildLogsResponseSchema
337
336
  );
338
337
  };
339
338
  await executeCall(call, options);
340
339
  if (resp === undefined) {
341
- throw new Error('API call completed without a result.');
340
+ throw new Error('operation completed without a result.');
342
341
  }
343
342
  return resp;
344
343
  }
@@ -347,10 +346,10 @@ export class ModelservingClient {
347
346
  async getServedModelLogs(
348
347
  req: GetServedModelLogsRequest,
349
348
  options?: CallOptions
350
- ): Promise<GetServedModelLogsRequest_Response> {
349
+ ): Promise<GetServedModelLogsResponse> {
351
350
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/served-models/${req.servedModelName ?? ''}/logs`;
352
- let resp: GetServedModelLogsRequest_Response | undefined;
353
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
351
+ let resp: GetServedModelLogsResponse | undefined;
352
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
354
353
  const headers = new Headers();
355
354
  if (this.workspaceId !== undefined) {
356
355
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -362,14 +361,11 @@ export class ModelservingClient {
362
361
  httpClient: this.httpClient,
363
362
  logger: this.logger,
364
363
  });
365
- resp = parseResponse(
366
- respBody,
367
- unmarshalGetServedModelLogsRequest_ResponseSchema
368
- );
364
+ resp = parseResponse(respBody, unmarshalGetServedModelLogsResponseSchema);
369
365
  };
370
366
  await executeCall(call, options);
371
367
  if (resp === undefined) {
372
- throw new Error('API call completed without a result.');
368
+ throw new Error('operation completed without a result.');
373
369
  }
374
370
  return resp;
375
371
  }
@@ -378,10 +374,10 @@ export class ModelservingClient {
378
374
  async listInferenceEndpoints(
379
375
  _req: ListInferenceEndpointsRequest,
380
376
  options?: CallOptions
381
- ): Promise<ListInferenceEndpointsRequest_Response> {
377
+ ): Promise<ListInferenceEndpointsResponse> {
382
378
  const url = `${this.host}/api/2.0/serving-endpoints`;
383
- let resp: ListInferenceEndpointsRequest_Response | undefined;
384
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
379
+ let resp: ListInferenceEndpointsResponse | undefined;
380
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
385
381
  const headers = new Headers();
386
382
  if (this.workspaceId !== undefined) {
387
383
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -395,12 +391,12 @@ export class ModelservingClient {
395
391
  });
396
392
  resp = parseResponse(
397
393
  respBody,
398
- unmarshalListInferenceEndpointsRequest_ResponseSchema
394
+ unmarshalListInferenceEndpointsResponseSchema
399
395
  );
400
396
  };
401
397
  await executeCall(call, options);
402
398
  if (resp === undefined) {
403
- throw new Error('API call completed without a result.');
399
+ throw new Error('operation completed without a result.');
404
400
  }
405
401
  return resp;
406
402
  }
@@ -409,14 +405,14 @@ export class ModelservingClient {
409
405
  async patchInferenceEndpointTags(
410
406
  req: PatchInferenceEndpointTagsRequest,
411
407
  options?: CallOptions
412
- ): Promise<PatchInferenceEndpointTagsRequest_Response> {
408
+ ): Promise<PatchInferenceEndpointTagsResponse> {
413
409
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/tags`;
414
410
  const body = marshalRequest(
415
411
  req,
416
412
  marshalPatchInferenceEndpointTagsRequestSchema
417
413
  );
418
- let resp: PatchInferenceEndpointTagsRequest_Response | undefined;
419
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
414
+ let resp: PatchInferenceEndpointTagsResponse | undefined;
415
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
420
416
  const headers = new Headers({'Content-Type': 'application/json'});
421
417
  if (this.workspaceId !== undefined) {
422
418
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -430,12 +426,12 @@ export class ModelservingClient {
430
426
  });
431
427
  resp = parseResponse(
432
428
  respBody,
433
- unmarshalPatchInferenceEndpointTagsRequest_ResponseSchema
429
+ unmarshalPatchInferenceEndpointTagsResponseSchema
434
430
  );
435
431
  };
436
432
  await executeCall(call, options);
437
433
  if (resp === undefined) {
438
- throw new Error('API call completed without a result.');
434
+ throw new Error('operation completed without a result.');
439
435
  }
440
436
  return resp;
441
437
  }
@@ -444,14 +440,14 @@ export class ModelservingClient {
444
440
  async putInferenceEndpointAiGateway(
445
441
  req: PutInferenceEndpointAiGatewayRequest,
446
442
  options?: CallOptions
447
- ): Promise<PutInferenceEndpointAiGatewayRequest_Response> {
443
+ ): Promise<PutInferenceEndpointAiGatewayResponse> {
448
444
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/ai-gateway`;
449
445
  const body = marshalRequest(
450
446
  req,
451
447
  marshalPutInferenceEndpointAiGatewayRequestSchema
452
448
  );
453
- let resp: PutInferenceEndpointAiGatewayRequest_Response | undefined;
454
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
449
+ let resp: PutInferenceEndpointAiGatewayResponse | undefined;
450
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
455
451
  const headers = new Headers({'Content-Type': 'application/json'});
456
452
  if (this.workspaceId !== undefined) {
457
453
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -465,18 +461,18 @@ export class ModelservingClient {
465
461
  });
466
462
  resp = parseResponse(
467
463
  respBody,
468
- unmarshalPutInferenceEndpointAiGatewayRequest_ResponseSchema
464
+ unmarshalPutInferenceEndpointAiGatewayResponseSchema
469
465
  );
470
466
  };
471
467
  await executeCall(call, options);
472
468
  if (resp === undefined) {
473
- throw new Error('API call completed without a result.');
469
+ throw new Error('operation completed without a result.');
474
470
  }
475
471
  return resp;
476
472
  }
477
473
 
478
474
  /** Updates any combination of the serving endpoint's served entities, the compute configuration of those served entities, and the endpoint's traffic config. An endpoint that already has an update in progress can not be updated until the current update completes or fails. */
479
- async putInferenceEndpointConfig(
475
+ private async putInferenceEndpointConfig(
480
476
  req: PutInferenceEndpointConfigRequest,
481
477
  options?: CallOptions
482
478
  ): Promise<InferenceEndpointDetailed> {
@@ -486,7 +482,7 @@ export class ModelservingClient {
486
482
  marshalPutInferenceEndpointConfigRequestSchema
487
483
  );
488
484
  let resp: InferenceEndpointDetailed | undefined;
489
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
485
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
490
486
  const headers = new Headers({'Content-Type': 'application/json'});
491
487
  if (this.workspaceId !== undefined) {
492
488
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -502,7 +498,7 @@ export class ModelservingClient {
502
498
  };
503
499
  await executeCall(call, options);
504
500
  if (resp === undefined) {
505
- throw new Error('API call completed without a result.');
501
+ throw new Error('operation completed without a result.');
506
502
  }
507
503
  return resp;
508
504
  }
@@ -522,14 +518,14 @@ export class ModelservingClient {
522
518
  async putInferenceEndpointRateLimits(
523
519
  req: PutInferenceEndpointRateLimitsRequest,
524
520
  options?: CallOptions
525
- ): Promise<PutInferenceEndpointRateLimitsRequest_Response> {
521
+ ): Promise<PutInferenceEndpointRateLimitsResponse> {
526
522
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/rate-limits`;
527
523
  const body = marshalRequest(
528
524
  req,
529
525
  marshalPutInferenceEndpointRateLimitsRequestSchema
530
526
  );
531
- let resp: PutInferenceEndpointRateLimitsRequest_Response | undefined;
532
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
527
+ let resp: PutInferenceEndpointRateLimitsResponse | undefined;
528
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
533
529
  const headers = new Headers({'Content-Type': 'application/json'});
534
530
  if (this.workspaceId !== undefined) {
535
531
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -543,25 +539,25 @@ export class ModelservingClient {
543
539
  });
544
540
  resp = parseResponse(
545
541
  respBody,
546
- unmarshalPutInferenceEndpointRateLimitsRequest_ResponseSchema
542
+ unmarshalPutInferenceEndpointRateLimitsResponseSchema
547
543
  );
548
544
  };
549
545
  await executeCall(call, options);
550
546
  if (resp === undefined) {
551
- throw new Error('API call completed without a result.');
547
+ throw new Error('operation completed without a result.');
552
548
  }
553
549
  return resp;
554
550
  }
555
551
 
556
552
  /** Updates any combination of the pt endpoint's served entities, the compute configuration of those served entities, and the endpoint's traffic config. Updates are instantaneous and endpoint should be updated instantly */
557
- async putProvisionedThroughputInferenceEndpointConfig(
553
+ private async putProvisionedThroughputInferenceEndpointConfig(
558
554
  req: PutPtEndpointConfigRequest,
559
555
  options?: CallOptions
560
556
  ): Promise<InferenceEndpointDetailed> {
561
557
  const url = `${this.host}/api/2.0/serving-endpoints/pt/${req.name ?? ''}/config`;
562
558
  const body = marshalRequest(req, marshalPutPtEndpointConfigRequestSchema);
563
559
  let resp: InferenceEndpointDetailed | undefined;
564
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
560
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
565
561
  const headers = new Headers({'Content-Type': 'application/json'});
566
562
  if (this.workspaceId !== undefined) {
567
563
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -577,7 +573,7 @@ export class ModelservingClient {
577
573
  };
578
574
  await executeCall(call, options);
579
575
  if (resp === undefined) {
580
- throw new Error('API call completed without a result.');
576
+ throw new Error('operation completed without a result.');
581
577
  }
582
578
  return resp;
583
579
  }
@@ -600,14 +596,14 @@ export class ModelservingClient {
600
596
  async updateInferenceEndpointNotifications(
601
597
  req: UpdateInferenceEndpointNotificationsRequest,
602
598
  options?: CallOptions
603
- ): Promise<UpdateInferenceEndpointNotificationsRequest_Response> {
599
+ ): Promise<UpdateInferenceEndpointNotificationsResponse> {
604
600
  const url = `${this.host}/api/2.0/serving-endpoints/${req.name ?? ''}/notifications`;
605
601
  const body = marshalRequest(
606
602
  req,
607
603
  marshalUpdateInferenceEndpointNotificationsRequestSchema
608
604
  );
609
- let resp: UpdateInferenceEndpointNotificationsRequest_Response | undefined;
610
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
605
+ let resp: UpdateInferenceEndpointNotificationsResponse | undefined;
606
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
611
607
  const headers = new Headers({'Content-Type': 'application/json'});
612
608
  if (this.workspaceId !== undefined) {
613
609
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -621,12 +617,12 @@ export class ModelservingClient {
621
617
  });
622
618
  resp = parseResponse(
623
619
  respBody,
624
- unmarshalUpdateInferenceEndpointNotificationsRequest_ResponseSchema
620
+ unmarshalUpdateInferenceEndpointNotificationsResponseSchema
625
621
  );
626
622
  };
627
623
  await executeCall(call, options);
628
624
  if (resp === undefined) {
629
- throw new Error('API call completed without a result.');
625
+ throw new Error('operation completed without a result.');
630
626
  }
631
627
  return resp;
632
628
  }
@@ -639,7 +635,7 @@ export class ModelservingClient {
639
635
  const url = `${this.host}/api/2.0/external-function`;
640
636
  const body = marshalRequest(req, marshalExternalFunctionRequestSchema);
641
637
  let resp: ExternalFunctionResponse | undefined;
642
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
638
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
643
639
  const headers = new Headers({'Content-Type': 'application/json'});
644
640
  if (this.workspaceId !== undefined) {
645
641
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -657,7 +653,7 @@ export class ModelservingClient {
657
653
  };
658
654
  await executeCall(call, options);
659
655
  if (resp === undefined) {
660
- throw new Error('API call completed without a result.');
656
+ throw new Error('operation completed without a result.');
661
657
  }
662
658
  return resp;
663
659
  }
@@ -665,7 +661,7 @@ export class ModelservingClient {
665
661
 
666
662
  export class CreateInferenceEndpointWaiter {
667
663
  constructor(
668
- private readonly client: ModelservingClient,
664
+ private readonly client: ModelServingClient,
669
665
  readonly name: string
670
666
  ) {}
671
667
 
@@ -674,15 +670,15 @@ export class CreateInferenceEndpointWaiter {
674
670
  *
675
671
  * Throws if a failure state is reached.
676
672
  */
677
- async wait(options?: CallOptions): Promise<InferenceEndpointDetailed> {
673
+ async wait(options?: LroOptions): Promise<InferenceEndpointDetailed> {
678
674
  let result: InferenceEndpointDetailed | undefined;
679
675
 
680
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
676
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
681
677
  const pollResp = await this.client.getInferenceEndpoint(
682
678
  {
683
679
  name: this.name,
684
680
  },
685
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
681
+ callSignal !== undefined ? {signal: callSignal} : undefined
686
682
  );
687
683
 
688
684
  const status = pollResp.state?.configUpdate;
@@ -704,16 +700,9 @@ export class CreateInferenceEndpointWaiter {
704
700
  }
705
701
  };
706
702
 
707
- const retryOptions: CallOptions = {
708
- ...(options?.signal !== undefined && {signal: options.signal}),
709
- retrier: () =>
710
- retryOn({}, (err: Error) => {
711
- return err instanceof StillRunningError;
712
- }),
713
- };
714
- await executeCall(call, retryOptions);
703
+ await executeWait(call, options);
715
704
  if (result === undefined) {
716
- throw new Error('API call completed without a result.');
705
+ throw new Error('operation completed without a result.');
717
706
  }
718
707
  return result;
719
708
  }
@@ -745,7 +734,7 @@ export class CreateInferenceEndpointWaiter {
745
734
 
746
735
  export class CreateProvisionedThroughputInferenceEndpointWaiter {
747
736
  constructor(
748
- private readonly client: ModelservingClient,
737
+ private readonly client: ModelServingClient,
749
738
  readonly name: string
750
739
  ) {}
751
740
 
@@ -754,15 +743,15 @@ export class CreateProvisionedThroughputInferenceEndpointWaiter {
754
743
  *
755
744
  * Throws if a failure state is reached.
756
745
  */
757
- async wait(options?: CallOptions): Promise<InferenceEndpointDetailed> {
746
+ async wait(options?: LroOptions): Promise<InferenceEndpointDetailed> {
758
747
  let result: InferenceEndpointDetailed | undefined;
759
748
 
760
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
749
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
761
750
  const pollResp = await this.client.getInferenceEndpoint(
762
751
  {
763
752
  name: this.name,
764
753
  },
765
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
754
+ callSignal !== undefined ? {signal: callSignal} : undefined
766
755
  );
767
756
 
768
757
  const status = pollResp.state?.configUpdate;
@@ -784,16 +773,9 @@ export class CreateProvisionedThroughputInferenceEndpointWaiter {
784
773
  }
785
774
  };
786
775
 
787
- const retryOptions: CallOptions = {
788
- ...(options?.signal !== undefined && {signal: options.signal}),
789
- retrier: () =>
790
- retryOn({}, (err: Error) => {
791
- return err instanceof StillRunningError;
792
- }),
793
- };
794
- await executeCall(call, retryOptions);
776
+ await executeWait(call, options);
795
777
  if (result === undefined) {
796
- throw new Error('API call completed without a result.');
778
+ throw new Error('operation completed without a result.');
797
779
  }
798
780
  return result;
799
781
  }
@@ -825,7 +807,7 @@ export class CreateProvisionedThroughputInferenceEndpointWaiter {
825
807
 
826
808
  export class PutInferenceEndpointConfigWaiter {
827
809
  constructor(
828
- private readonly client: ModelservingClient,
810
+ private readonly client: ModelServingClient,
829
811
  readonly name: string
830
812
  ) {}
831
813
 
@@ -834,15 +816,15 @@ export class PutInferenceEndpointConfigWaiter {
834
816
  *
835
817
  * Throws if a failure state is reached.
836
818
  */
837
- async wait(options?: CallOptions): Promise<InferenceEndpointDetailed> {
819
+ async wait(options?: LroOptions): Promise<InferenceEndpointDetailed> {
838
820
  let result: InferenceEndpointDetailed | undefined;
839
821
 
840
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
822
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
841
823
  const pollResp = await this.client.getInferenceEndpoint(
842
824
  {
843
825
  name: this.name,
844
826
  },
845
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
827
+ callSignal !== undefined ? {signal: callSignal} : undefined
846
828
  );
847
829
 
848
830
  const status = pollResp.state?.configUpdate;
@@ -864,16 +846,9 @@ export class PutInferenceEndpointConfigWaiter {
864
846
  }
865
847
  };
866
848
 
867
- const retryOptions: CallOptions = {
868
- ...(options?.signal !== undefined && {signal: options.signal}),
869
- retrier: () =>
870
- retryOn({}, (err: Error) => {
871
- return err instanceof StillRunningError;
872
- }),
873
- };
874
- await executeCall(call, retryOptions);
849
+ await executeWait(call, options);
875
850
  if (result === undefined) {
876
- throw new Error('API call completed without a result.');
851
+ throw new Error('operation completed without a result.');
877
852
  }
878
853
  return result;
879
854
  }
@@ -905,7 +880,7 @@ export class PutInferenceEndpointConfigWaiter {
905
880
 
906
881
  export class PutProvisionedThroughputInferenceEndpointConfigWaiter {
907
882
  constructor(
908
- private readonly client: ModelservingClient,
883
+ private readonly client: ModelServingClient,
909
884
  readonly name: string
910
885
  ) {}
911
886
 
@@ -914,15 +889,15 @@ export class PutProvisionedThroughputInferenceEndpointConfigWaiter {
914
889
  *
915
890
  * Throws if a failure state is reached.
916
891
  */
917
- async wait(options?: CallOptions): Promise<InferenceEndpointDetailed> {
892
+ async wait(options?: LroOptions): Promise<InferenceEndpointDetailed> {
918
893
  let result: InferenceEndpointDetailed | undefined;
919
894
 
920
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
895
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
921
896
  const pollResp = await this.client.getInferenceEndpoint(
922
897
  {
923
898
  name: this.name,
924
899
  },
925
- {...options, ...(callSignal !== undefined && {signal: callSignal})}
900
+ callSignal !== undefined ? {signal: callSignal} : undefined
926
901
  );
927
902
 
928
903
  const status = pollResp.state?.configUpdate;
@@ -944,16 +919,9 @@ export class PutProvisionedThroughputInferenceEndpointConfigWaiter {
944
919
  }
945
920
  };
946
921
 
947
- const retryOptions: CallOptions = {
948
- ...(options?.signal !== undefined && {signal: options.signal}),
949
- retrier: () =>
950
- retryOn({}, (err: Error) => {
951
- return err instanceof StillRunningError;
952
- }),
953
- };
954
- await executeCall(call, retryOptions);
922
+ await executeWait(call, options);
955
923
  if (result === undefined) {
956
- throw new Error('API call completed without a result.');
924
+ throw new Error('operation completed without a result.');
957
925
  }
958
926
  return result;
959
927
  }