@databricks/sdk-marketplaces 0.1.0-dev.1 → 0.1.0-dev.2

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/dist/v1/client.js CHANGED
@@ -5,7 +5,7 @@ import { NoOpLogger } from '@databricks/sdk-core/logger';
5
5
  import { newHttpClient } from './transport';
6
6
  import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, flattenQueryParams, } from './utils';
7
7
  import pkgJson from '../../package.json' with { type: 'json' };
8
- import { marshalAddExchangeForListingRequestSchema, marshalCreateExchangeFilterRequestSchema, marshalCreateExchangeRequestSchema, marshalCreateFileRequestSchema, marshalCreateListingRequestSchema, marshalCreatePersonalizationRequestSchema, marshalCreateProviderAnalyticsDashboardRequestSchema, marshalCreateProviderRequestSchema, marshalFileParentSchema, marshalInstallListingSchema, marshalListingTagSchema, marshalUpdateExchangeFilterRequestSchema, marshalUpdateExchangeRequestSchema, marshalUpdateInstallationDetailSchema, marshalUpdateListingRequestSchema, marshalUpdatePersonalizationRequestStatusRequestSchema, marshalUpdateProviderAnalyticsDashboardRequestSchema, marshalUpdateProviderRequestSchema, unmarshalAddExchangeForListingResponseSchema, unmarshalBatchGetListingsResponseSchema, unmarshalBatchGetProvidersResponseSchema, unmarshalCreateExchangeFilterResponseSchema, unmarshalCreateExchangeResponseSchema, unmarshalCreateFileRequest_ResponseSchema, unmarshalCreateListingRequest_ResponseSchema, unmarshalCreatePersonalizationRequest_ResponseSchema, unmarshalCreateProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalCreateProviderRequest_ResponseSchema, unmarshalDeleteExchangeFilterResponseSchema, unmarshalDeleteExchangeResponseSchema, unmarshalDeleteFileRequest_ResponseSchema, unmarshalDeleteListingRequest_ResponseSchema, unmarshalDeleteProviderRequest_ResponseSchema, unmarshalGetAllInstallations_ResponseSchema, unmarshalGetAllPersonalizationRequestsForConsumer_ResponseSchema, unmarshalGetExchangeResponseSchema, unmarshalGetFileRequest_ResponseSchema, unmarshalGetInstallationDetails_ResponseSchema, unmarshalGetLatestVersionProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalGetListingContent_ResponseSchema, unmarshalGetListingFulfillments_ResponseSchema, unmarshalGetListingRequest_ResponseSchema, unmarshalGetListingsRequest_ResponseSchema, unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema, unmarshalGetPersonalizationRequestsForProviderRequest_ResponseSchema, unmarshalGetProviderRequest_ResponseSchema, unmarshalGetPublishedListingForConsumer_ResponseSchema, unmarshalGetPublishedListingsForConsumer_ResponseSchema, unmarshalGetPublishedProviderForConsumer_ResponseSchema, unmarshalInstallListing_ResponseSchema, unmarshalListExchangeFiltersResponseSchema, unmarshalListExchangesForListingResponseSchema, unmarshalListExchangesResponseSchema, unmarshalListFilesRequest_ResponseSchema, unmarshalListListingsForExchangeResponseSchema, unmarshalListProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalListProvidersRequest_ResponseSchema, unmarshalListPublishedProvidersForConsumer_ResponseSchema, unmarshalRemoveExchangeForListingResponseSchema, unmarshalSearchPublishedListingsForConsumer_ResponseSchema, unmarshalUninstallListing_ResponseSchema, unmarshalUpdateExchangeFilterResponseSchema, unmarshalUpdateExchangeResponseSchema, unmarshalUpdateInstallationDetail_ResponseSchema, unmarshalUpdateListingRequest_ResponseSchema, unmarshalUpdatePersonalizationRequestStatusRequest_ResponseSchema, unmarshalUpdateProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalUpdateProviderRequest_ResponseSchema, } from './model';
8
+ import { marshalAddExchangeForListingRequestSchema, marshalCreateExchangeFilterRequestSchema, marshalCreateExchangeRequestSchema, marshalCreateFileRequestSchema, marshalCreateListingRequestSchema, marshalCreatePersonalizationRequestSchema, marshalCreateProviderAnalyticsDashboardRequestSchema, marshalCreateProviderRequestSchema, marshalFileParentSchema, marshalInstallListingSchema, marshalListingTagSchema, marshalUpdateExchangeFilterRequestSchema, marshalUpdateExchangeRequestSchema, marshalUpdateInstallationDetailSchema, marshalUpdateListingRequestSchema, marshalUpdatePersonalizationRequestStatusRequestSchema, marshalUpdateProviderAnalyticsDashboardRequestSchema, marshalUpdateProviderRequestSchema, unmarshalAddExchangeForListingResponseSchema, unmarshalBatchGetListingsResponseSchema, unmarshalBatchGetProvidersResponseSchema, unmarshalCreateExchangeFilterResponseSchema, unmarshalCreateExchangeResponseSchema, unmarshalCreateFileRequest_ResponseSchema, unmarshalCreateListingRequest_ResponseSchema, unmarshalCreatePersonalizationRequest_ResponseSchema, unmarshalCreateProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalCreateProviderRequest_ResponseSchema, unmarshalDeleteExchangeFilterResponseSchema, unmarshalDeleteExchangeResponseSchema, unmarshalDeleteFileRequest_ResponseSchema, unmarshalDeleteListingRequest_ResponseSchema, unmarshalDeleteProviderRequest_ResponseSchema, unmarshalGetExchangeResponseSchema, unmarshalGetFileRequest_ResponseSchema, unmarshalGetInstallationDetails_ResponseSchema, unmarshalGetLatestVersionProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalGetListingContent_ResponseSchema, unmarshalGetListingRequest_ResponseSchema, unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema, unmarshalGetPersonalizationRequestsForProviderRequest_ResponseSchema, unmarshalGetProviderRequest_ResponseSchema, unmarshalGetPublishedListingForConsumer_ResponseSchema, unmarshalGetPublishedProviderForConsumer_ResponseSchema, unmarshalInstallListing_ResponseSchema, unmarshalListExchangeFiltersResponseSchema, unmarshalListExchangesForListingResponseSchema, unmarshalListExchangesResponseSchema, unmarshalListFilesRequest_ResponseSchema, unmarshalListInstallationsRequest_ResponseSchema, unmarshalListListingFulfillmentsRequest_ResponseSchema, unmarshalListListingsForExchangeResponseSchema, unmarshalListListingsRequest_ResponseSchema, unmarshalListPersonalizationRequestsForConsumerRequest_ResponseSchema, unmarshalListProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalListProvidersRequest_ResponseSchema, unmarshalListPublishedListingsForConsumerRequest_ResponseSchema, unmarshalListPublishedProvidersForConsumer_ResponseSchema, unmarshalRemoveExchangeForListingResponseSchema, unmarshalSearchPublishedListingsForConsumer_ResponseSchema, unmarshalUninstallListing_ResponseSchema, unmarshalUpdateExchangeFilterResponseSchema, unmarshalUpdateExchangeResponseSchema, unmarshalUpdateInstallationDetail_ResponseSchema, unmarshalUpdateListingRequest_ResponseSchema, unmarshalUpdatePersonalizationRequestStatusRequest_ResponseSchema, unmarshalUpdateProviderAnalyticsDashboardRequest_ResponseSchema, unmarshalUpdateProviderRequest_ResponseSchema, } from './model';
9
9
  // Package identity segment for this client to be used in the User-Agent header.
10
10
  const PACKAGE_SEGMENT = {
11
11
  key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
@@ -63,7 +63,7 @@ export class MarketplacesClient {
63
63
  };
64
64
  await executeCall(call, options);
65
65
  if (resp === undefined) {
66
- throw new Error('API call completed without a result.');
66
+ throw new Error('operation completed without a result.');
67
67
  }
68
68
  return resp;
69
69
  }
@@ -93,7 +93,7 @@ export class MarketplacesClient {
93
93
  };
94
94
  await executeCall(call, options);
95
95
  if (resp === undefined) {
96
- throw new Error('API call completed without a result.');
96
+ throw new Error('operation completed without a result.');
97
97
  }
98
98
  return resp;
99
99
  }
@@ -118,13 +118,13 @@ export class MarketplacesClient {
118
118
  };
119
119
  await executeCall(call, options);
120
120
  if (resp === undefined) {
121
- throw new Error('API call completed without a result.');
121
+ throw new Error('operation completed without a result.');
122
122
  }
123
123
  return resp;
124
124
  }
125
- /** List all installations across all listings. */
126
- async getAllInstallations(req, options) {
127
- const url = `${this.host}/api/2.0/marketplace-consumer/installations`;
125
+ /** List all installations for a particular listing. */
126
+ async getInstallationDetails(req, options) {
127
+ const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
128
128
  const params = new URLSearchParams();
129
129
  if (req.pageToken !== undefined) {
130
130
  params.append('page_token', req.pageToken);
@@ -147,18 +147,18 @@ export class MarketplacesClient {
147
147
  httpClient: this.httpClient,
148
148
  logger: this.logger,
149
149
  });
150
- resp = parseResponse(respBody, unmarshalGetAllInstallations_ResponseSchema);
150
+ resp = parseResponse(respBody, unmarshalGetInstallationDetails_ResponseSchema);
151
151
  };
152
152
  await executeCall(call, options);
153
153
  if (resp === undefined) {
154
- throw new Error('API call completed without a result.');
154
+ throw new Error('operation completed without a result.');
155
155
  }
156
156
  return resp;
157
157
  }
158
- async *getAllInstallationsIter(req, options) {
158
+ async *getInstallationDetailsIter(req, options) {
159
159
  const pageReq = { ...req };
160
160
  for (;;) {
161
- const resp = await this.getAllInstallations(pageReq, options);
161
+ const resp = await this.getInstallationDetails(pageReq, options);
162
162
  for (const item of resp.installations ?? []) {
163
163
  yield item;
164
164
  }
@@ -168,9 +168,9 @@ export class MarketplacesClient {
168
168
  pageReq.pageToken = resp.nextPageToken;
169
169
  }
170
170
  }
171
- /** List personalization requests for a consumer across all listings. */
172
- async getAllPersonalizationRequestsForConsumer(req, options) {
173
- const url = `${this.host}/api/2.0/marketplace-consumer/personalization-requests`;
171
+ /** Get a high level preview of the metadata of listing installable content. */
172
+ async getListingContent(req, options) {
173
+ const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/content`;
174
174
  const params = new URLSearchParams();
175
175
  if (req.pageToken !== undefined) {
176
176
  params.append('page_token', req.pageToken);
@@ -193,19 +193,19 @@ export class MarketplacesClient {
193
193
  httpClient: this.httpClient,
194
194
  logger: this.logger,
195
195
  });
196
- resp = parseResponse(respBody, unmarshalGetAllPersonalizationRequestsForConsumer_ResponseSchema);
196
+ resp = parseResponse(respBody, unmarshalGetListingContent_ResponseSchema);
197
197
  };
198
198
  await executeCall(call, options);
199
199
  if (resp === undefined) {
200
- throw new Error('API call completed without a result.');
200
+ throw new Error('operation completed without a result.');
201
201
  }
202
202
  return resp;
203
203
  }
204
- async *getAllPersonalizationRequestsForConsumerIter(req, options) {
204
+ async *getListingContentIter(req, options) {
205
205
  const pageReq = { ...req };
206
206
  for (;;) {
207
- const resp = await this.getAllPersonalizationRequestsForConsumer(pageReq, options);
208
- for (const item of resp.personalizationRequests ?? []) {
207
+ const resp = await this.getListingContent(pageReq, options);
208
+ for (const item of resp.sharedDataObjects ?? []) {
209
209
  yield item;
210
210
  }
211
211
  if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
@@ -214,18 +214,33 @@ export class MarketplacesClient {
214
214
  pageReq.pageToken = resp.nextPageToken;
215
215
  }
216
216
  }
217
- /** List all installations for a particular listing. */
218
- async getInstallationDetails(req, options) {
219
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
220
- const params = new URLSearchParams();
221
- if (req.pageToken !== undefined) {
222
- params.append('page_token', req.pageToken);
223
- }
224
- if (req.pageSize !== undefined) {
225
- params.append('page_size', String(req.pageSize));
217
+ /** Get the personalization request for a listing. Each consumer can make at *most* one personalization request for a listing. */
218
+ async getPersonalizationRequestsForConsumer(req, options) {
219
+ const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/personalization-requests`;
220
+ let resp;
221
+ const call = async (callSignal) => {
222
+ const headers = new Headers();
223
+ if (this.workspaceId !== undefined) {
224
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
225
+ }
226
+ headers.set('User-Agent', this.userAgent);
227
+ const httpReq = buildHttpRequest('GET', url, headers, callSignal);
228
+ const respBody = await executeHttpCall({
229
+ request: httpReq,
230
+ httpClient: this.httpClient,
231
+ logger: this.logger,
232
+ });
233
+ resp = parseResponse(respBody, unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema);
234
+ };
235
+ await executeCall(call, options);
236
+ if (resp === undefined) {
237
+ throw new Error('operation completed without a result.');
226
238
  }
227
- const query = params.toString();
228
- const fullUrl = query !== '' ? `${url}?${query}` : url;
239
+ return resp;
240
+ }
241
+ /** Get a published listing in the Databricks Marketplace that the consumer has access to. */
242
+ async getPublishedListingForConsumer(req, options) {
243
+ const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.id ?? ''}`;
229
244
  let resp;
230
245
  const call = async (callSignal) => {
231
246
  const headers = new Headers();
@@ -233,36 +248,72 @@ export class MarketplacesClient {
233
248
  headers.set('X-Databricks-Org-Id', this.workspaceId);
234
249
  }
235
250
  headers.set('User-Agent', this.userAgent);
236
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
251
+ const httpReq = buildHttpRequest('GET', url, headers, callSignal);
237
252
  const respBody = await executeHttpCall({
238
253
  request: httpReq,
239
254
  httpClient: this.httpClient,
240
255
  logger: this.logger,
241
256
  });
242
- resp = parseResponse(respBody, unmarshalGetInstallationDetails_ResponseSchema);
257
+ resp = parseResponse(respBody, unmarshalGetPublishedListingForConsumer_ResponseSchema);
243
258
  };
244
259
  await executeCall(call, options);
245
260
  if (resp === undefined) {
246
- throw new Error('API call completed without a result.');
261
+ throw new Error('operation completed without a result.');
247
262
  }
248
263
  return resp;
249
264
  }
250
- async *getInstallationDetailsIter(req, options) {
251
- const pageReq = { ...req };
252
- for (;;) {
253
- const resp = await this.getInstallationDetails(pageReq, options);
254
- for (const item of resp.installations ?? []) {
255
- yield item;
265
+ /** Get a provider in the Databricks Marketplace with at least one visible listing. */
266
+ async getPublishedProviderForConsumer(req, options) {
267
+ const url = `${this.host}/api/2.0/marketplace-consumer/providers/${req.id ?? ''}`;
268
+ let resp;
269
+ const call = async (callSignal) => {
270
+ const headers = new Headers();
271
+ if (this.workspaceId !== undefined) {
272
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
256
273
  }
257
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
258
- return;
274
+ headers.set('User-Agent', this.userAgent);
275
+ const httpReq = buildHttpRequest('GET', url, headers, callSignal);
276
+ const respBody = await executeHttpCall({
277
+ request: httpReq,
278
+ httpClient: this.httpClient,
279
+ logger: this.logger,
280
+ });
281
+ resp = parseResponse(respBody, unmarshalGetPublishedProviderForConsumer_ResponseSchema);
282
+ };
283
+ await executeCall(call, options);
284
+ if (resp === undefined) {
285
+ throw new Error('operation completed without a result.');
286
+ }
287
+ return resp;
288
+ }
289
+ /** Install payload associated with a Databricks Marketplace listing. */
290
+ async installListing(req, options) {
291
+ const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
292
+ const body = marshalRequest(req, marshalInstallListingSchema);
293
+ let resp;
294
+ const call = async (callSignal) => {
295
+ const headers = new Headers({ 'Content-Type': 'application/json' });
296
+ if (this.workspaceId !== undefined) {
297
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
259
298
  }
260
- pageReq.pageToken = resp.nextPageToken;
299
+ headers.set('User-Agent', this.userAgent);
300
+ const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
301
+ const respBody = await executeHttpCall({
302
+ request: httpReq,
303
+ httpClient: this.httpClient,
304
+ logger: this.logger,
305
+ });
306
+ resp = parseResponse(respBody, unmarshalInstallListing_ResponseSchema);
307
+ };
308
+ await executeCall(call, options);
309
+ if (resp === undefined) {
310
+ throw new Error('operation completed without a result.');
261
311
  }
312
+ return resp;
262
313
  }
263
- /** Get a high level preview of the metadata of listing installable content. */
264
- async getListingContent(req, options) {
265
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/content`;
314
+ /** List all installations across all listings. */
315
+ async listInstallations(req, options) {
316
+ const url = `${this.host}/api/2.0/marketplace-consumer/installations`;
266
317
  const params = new URLSearchParams();
267
318
  if (req.pageToken !== undefined) {
268
319
  params.append('page_token', req.pageToken);
@@ -285,19 +336,19 @@ export class MarketplacesClient {
285
336
  httpClient: this.httpClient,
286
337
  logger: this.logger,
287
338
  });
288
- resp = parseResponse(respBody, unmarshalGetListingContent_ResponseSchema);
339
+ resp = parseResponse(respBody, unmarshalListInstallationsRequest_ResponseSchema);
289
340
  };
290
341
  await executeCall(call, options);
291
342
  if (resp === undefined) {
292
- throw new Error('API call completed without a result.');
343
+ throw new Error('operation completed without a result.');
293
344
  }
294
345
  return resp;
295
346
  }
296
- async *getListingContentIter(req, options) {
347
+ async *listInstallationsIter(req, options) {
297
348
  const pageReq = { ...req };
298
349
  for (;;) {
299
- const resp = await this.getListingContent(pageReq, options);
300
- for (const item of resp.sharedDataObjects ?? []) {
350
+ const resp = await this.listInstallations(pageReq, options);
351
+ for (const item of resp.installations ?? []) {
301
352
  yield item;
302
353
  }
303
354
  if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
@@ -311,7 +362,7 @@ export class MarketplacesClient {
311
362
  * Standard installations contain metadata about the attached share or git repo. Only one of these fields will be present.
312
363
  * Personalized installations contain metadata about the attached share or git repo, as well as the Delta Sharing recipient type.
313
364
  */
314
- async getListingFulfillments(req, options) {
365
+ async listListingFulfillments(req, options) {
315
366
  const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/fulfillments`;
316
367
  const params = new URLSearchParams();
317
368
  if (req.pageToken !== undefined) {
@@ -335,18 +386,18 @@ export class MarketplacesClient {
335
386
  httpClient: this.httpClient,
336
387
  logger: this.logger,
337
388
  });
338
- resp = parseResponse(respBody, unmarshalGetListingFulfillments_ResponseSchema);
389
+ resp = parseResponse(respBody, unmarshalListListingFulfillmentsRequest_ResponseSchema);
339
390
  };
340
391
  await executeCall(call, options);
341
392
  if (resp === undefined) {
342
- throw new Error('API call completed without a result.');
393
+ throw new Error('operation completed without a result.');
343
394
  }
344
395
  return resp;
345
396
  }
346
- async *getListingFulfillmentsIter(req, options) {
397
+ async *listListingFulfillmentsIter(req, options) {
347
398
  const pageReq = { ...req };
348
399
  for (;;) {
349
- const resp = await this.getListingFulfillments(pageReq, options);
400
+ const resp = await this.listListingFulfillments(pageReq, options);
350
401
  for (const item of resp.fulfillments ?? []) {
351
402
  yield item;
352
403
  }
@@ -356,9 +407,18 @@ export class MarketplacesClient {
356
407
  pageReq.pageToken = resp.nextPageToken;
357
408
  }
358
409
  }
359
- /** Get the personalization request for a listing. Each consumer can make at *most* one personalization request for a listing. */
360
- async getPersonalizationRequestsForConsumer(req, options) {
361
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/personalization-requests`;
410
+ /** List personalization requests for a consumer across all listings. */
411
+ async listPersonalizationRequestsForConsumer(req, options) {
412
+ const url = `${this.host}/api/2.0/marketplace-consumer/personalization-requests`;
413
+ const params = new URLSearchParams();
414
+ if (req.pageToken !== undefined) {
415
+ params.append('page_token', req.pageToken);
416
+ }
417
+ if (req.pageSize !== undefined) {
418
+ params.append('page_size', String(req.pageSize));
419
+ }
420
+ const query = params.toString();
421
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
362
422
  let resp;
363
423
  const call = async (callSignal) => {
364
424
  const headers = new Headers();
@@ -366,46 +426,35 @@ export class MarketplacesClient {
366
426
  headers.set('X-Databricks-Org-Id', this.workspaceId);
367
427
  }
368
428
  headers.set('User-Agent', this.userAgent);
369
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
429
+ const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
370
430
  const respBody = await executeHttpCall({
371
431
  request: httpReq,
372
432
  httpClient: this.httpClient,
373
433
  logger: this.logger,
374
434
  });
375
- resp = parseResponse(respBody, unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema);
435
+ resp = parseResponse(respBody, unmarshalListPersonalizationRequestsForConsumerRequest_ResponseSchema);
376
436
  };
377
437
  await executeCall(call, options);
378
438
  if (resp === undefined) {
379
- throw new Error('API call completed without a result.');
439
+ throw new Error('operation completed without a result.');
380
440
  }
381
441
  return resp;
382
442
  }
383
- /** Get a published listing in the Databricks Marketplace that the consumer has access to. */
384
- async getPublishedListingForConsumer(req, options) {
385
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.id ?? ''}`;
386
- let resp;
387
- const call = async (callSignal) => {
388
- const headers = new Headers();
389
- if (this.workspaceId !== undefined) {
390
- headers.set('X-Databricks-Org-Id', this.workspaceId);
443
+ async *listPersonalizationRequestsForConsumerIter(req, options) {
444
+ const pageReq = { ...req };
445
+ for (;;) {
446
+ const resp = await this.listPersonalizationRequestsForConsumer(pageReq, options);
447
+ for (const item of resp.personalizationRequests ?? []) {
448
+ yield item;
391
449
  }
392
- headers.set('User-Agent', this.userAgent);
393
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
394
- const respBody = await executeHttpCall({
395
- request: httpReq,
396
- httpClient: this.httpClient,
397
- logger: this.logger,
398
- });
399
- resp = parseResponse(respBody, unmarshalGetPublishedListingForConsumer_ResponseSchema);
400
- };
401
- await executeCall(call, options);
402
- if (resp === undefined) {
403
- throw new Error('API call completed without a result.');
450
+ if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
451
+ return;
452
+ }
453
+ pageReq.pageToken = resp.nextPageToken;
404
454
  }
405
- return resp;
406
455
  }
407
456
  /** List all published listings in the Databricks Marketplace that the consumer has access to. */
408
- async getPublishedListingsForConsumer(req, options) {
457
+ async listPublishedListingsForConsumer(req, options) {
409
458
  const url = `${this.host}/api/2.0/marketplace-consumer/listings`;
410
459
  const params = new URLSearchParams();
411
460
  if (req.pageToken !== undefined) {
@@ -450,18 +499,18 @@ export class MarketplacesClient {
450
499
  httpClient: this.httpClient,
451
500
  logger: this.logger,
452
501
  });
453
- resp = parseResponse(respBody, unmarshalGetPublishedListingsForConsumer_ResponseSchema);
502
+ resp = parseResponse(respBody, unmarshalListPublishedListingsForConsumerRequest_ResponseSchema);
454
503
  };
455
504
  await executeCall(call, options);
456
505
  if (resp === undefined) {
457
- throw new Error('API call completed without a result.');
506
+ throw new Error('operation completed without a result.');
458
507
  }
459
508
  return resp;
460
509
  }
461
- async *getPublishedListingsForConsumerIter(req, options) {
510
+ async *listPublishedListingsForConsumerIter(req, options) {
462
511
  const pageReq = { ...req };
463
512
  for (;;) {
464
- const resp = await this.getPublishedListingsForConsumer(pageReq, options);
513
+ const resp = await this.listPublishedListingsForConsumer(pageReq, options);
465
514
  for (const item of resp.listings ?? []) {
466
515
  yield item;
467
516
  }
@@ -471,55 +520,6 @@ export class MarketplacesClient {
471
520
  pageReq.pageToken = resp.nextPageToken;
472
521
  }
473
522
  }
474
- /** Get a provider in the Databricks Marketplace with at least one visible listing. */
475
- async getPublishedProviderForConsumer(req, options) {
476
- const url = `${this.host}/api/2.0/marketplace-consumer/providers/${req.id ?? ''}`;
477
- let resp;
478
- const call = async (callSignal) => {
479
- const headers = new Headers();
480
- if (this.workspaceId !== undefined) {
481
- headers.set('X-Databricks-Org-Id', this.workspaceId);
482
- }
483
- headers.set('User-Agent', this.userAgent);
484
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
485
- const respBody = await executeHttpCall({
486
- request: httpReq,
487
- httpClient: this.httpClient,
488
- logger: this.logger,
489
- });
490
- resp = parseResponse(respBody, unmarshalGetPublishedProviderForConsumer_ResponseSchema);
491
- };
492
- await executeCall(call, options);
493
- if (resp === undefined) {
494
- throw new Error('API call completed without a result.');
495
- }
496
- return resp;
497
- }
498
- /** Install payload associated with a Databricks Marketplace listing. */
499
- async installListing(req, options) {
500
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
501
- const body = marshalRequest(req, marshalInstallListingSchema);
502
- let resp;
503
- const call = async (callSignal) => {
504
- const headers = new Headers({ 'Content-Type': 'application/json' });
505
- if (this.workspaceId !== undefined) {
506
- headers.set('X-Databricks-Org-Id', this.workspaceId);
507
- }
508
- headers.set('User-Agent', this.userAgent);
509
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
510
- const respBody = await executeHttpCall({
511
- request: httpReq,
512
- httpClient: this.httpClient,
513
- logger: this.logger,
514
- });
515
- resp = parseResponse(respBody, unmarshalInstallListing_ResponseSchema);
516
- };
517
- await executeCall(call, options);
518
- if (resp === undefined) {
519
- throw new Error('API call completed without a result.');
520
- }
521
- return resp;
522
- }
523
523
  /** List all providers in the Databricks Marketplace with at least one visible listing. */
524
524
  async listPublishedProvidersForConsumer(req, options) {
525
525
  const url = `${this.host}/api/2.0/marketplace-consumer/providers`;
@@ -552,7 +552,7 @@ export class MarketplacesClient {
552
552
  };
553
553
  await executeCall(call, options);
554
554
  if (resp === undefined) {
555
- throw new Error('API call completed without a result.');
555
+ throw new Error('operation completed without a result.');
556
556
  }
557
557
  return resp;
558
558
  }
@@ -619,7 +619,7 @@ export class MarketplacesClient {
619
619
  };
620
620
  await executeCall(call, options);
621
621
  if (resp === undefined) {
622
- throw new Error('API call completed without a result.');
622
+ throw new Error('operation completed without a result.');
623
623
  }
624
624
  return resp;
625
625
  }
@@ -656,7 +656,7 @@ export class MarketplacesClient {
656
656
  };
657
657
  await executeCall(call, options);
658
658
  if (resp === undefined) {
659
- throw new Error('API call completed without a result.');
659
+ throw new Error('operation completed without a result.');
660
660
  }
661
661
  return resp;
662
662
  }
@@ -686,7 +686,7 @@ export class MarketplacesClient {
686
686
  };
687
687
  await executeCall(call, options);
688
688
  if (resp === undefined) {
689
- throw new Error('API call completed without a result.');
689
+ throw new Error('operation completed without a result.');
690
690
  }
691
691
  return resp;
692
692
  }
@@ -711,7 +711,7 @@ export class MarketplacesClient {
711
711
  };
712
712
  await executeCall(call, options);
713
713
  if (resp === undefined) {
714
- throw new Error('API call completed without a result.');
714
+ throw new Error('operation completed without a result.');
715
715
  }
716
716
  return resp;
717
717
  }
@@ -736,7 +736,7 @@ export class MarketplacesClient {
736
736
  };
737
737
  await executeCall(call, options);
738
738
  if (resp === undefined) {
739
- throw new Error('API call completed without a result.');
739
+ throw new Error('operation completed without a result.');
740
740
  }
741
741
  return resp;
742
742
  }
@@ -761,7 +761,7 @@ export class MarketplacesClient {
761
761
  };
762
762
  await executeCall(call, options);
763
763
  if (resp === undefined) {
764
- throw new Error('API call completed without a result.');
764
+ throw new Error('operation completed without a result.');
765
765
  }
766
766
  return resp;
767
767
  }
@@ -786,7 +786,7 @@ export class MarketplacesClient {
786
786
  };
787
787
  await executeCall(call, options);
788
788
  if (resp === undefined) {
789
- throw new Error('API call completed without a result.');
789
+ throw new Error('operation completed without a result.');
790
790
  }
791
791
  return resp;
792
792
  }
@@ -811,7 +811,7 @@ export class MarketplacesClient {
811
811
  };
812
812
  await executeCall(call, options);
813
813
  if (resp === undefined) {
814
- throw new Error('API call completed without a result.');
814
+ throw new Error('operation completed without a result.');
815
815
  }
816
816
  return resp;
817
817
  }
@@ -836,7 +836,7 @@ export class MarketplacesClient {
836
836
  };
837
837
  await executeCall(call, options);
838
838
  if (resp === undefined) {
839
- throw new Error('API call completed without a result.');
839
+ throw new Error('operation completed without a result.');
840
840
  }
841
841
  return resp;
842
842
  }
@@ -861,7 +861,7 @@ export class MarketplacesClient {
861
861
  };
862
862
  await executeCall(call, options);
863
863
  if (resp === undefined) {
864
- throw new Error('API call completed without a result.');
864
+ throw new Error('operation completed without a result.');
865
865
  }
866
866
  return resp;
867
867
  }
@@ -885,7 +885,7 @@ export class MarketplacesClient {
885
885
  };
886
886
  await executeCall(call, options);
887
887
  if (resp === undefined) {
888
- throw new Error('API call completed without a result.');
888
+ throw new Error('operation completed without a result.');
889
889
  }
890
890
  return resp;
891
891
  }
@@ -909,7 +909,7 @@ export class MarketplacesClient {
909
909
  };
910
910
  await executeCall(call, options);
911
911
  if (resp === undefined) {
912
- throw new Error('API call completed without a result.');
912
+ throw new Error('operation completed without a result.');
913
913
  }
914
914
  return resp;
915
915
  }
@@ -933,7 +933,7 @@ export class MarketplacesClient {
933
933
  };
934
934
  await executeCall(call, options);
935
935
  if (resp === undefined) {
936
- throw new Error('API call completed without a result.');
936
+ throw new Error('operation completed without a result.');
937
937
  }
938
938
  return resp;
939
939
  }
@@ -957,7 +957,7 @@ export class MarketplacesClient {
957
957
  };
958
958
  await executeCall(call, options);
959
959
  if (resp === undefined) {
960
- throw new Error('API call completed without a result.');
960
+ throw new Error('operation completed without a result.');
961
961
  }
962
962
  return resp;
963
963
  }
@@ -981,7 +981,7 @@ export class MarketplacesClient {
981
981
  };
982
982
  await executeCall(call, options);
983
983
  if (resp === undefined) {
984
- throw new Error('API call completed without a result.');
984
+ throw new Error('operation completed without a result.');
985
985
  }
986
986
  return resp;
987
987
  }
@@ -1005,7 +1005,7 @@ export class MarketplacesClient {
1005
1005
  };
1006
1006
  await executeCall(call, options);
1007
1007
  if (resp === undefined) {
1008
- throw new Error('API call completed without a result.');
1008
+ throw new Error('operation completed without a result.');
1009
1009
  }
1010
1010
  return resp;
1011
1011
  }
@@ -1029,7 +1029,7 @@ export class MarketplacesClient {
1029
1029
  };
1030
1030
  await executeCall(call, options);
1031
1031
  if (resp === undefined) {
1032
- throw new Error('API call completed without a result.');
1032
+ throw new Error('operation completed without a result.');
1033
1033
  }
1034
1034
  return resp;
1035
1035
  }
@@ -1053,7 +1053,7 @@ export class MarketplacesClient {
1053
1053
  };
1054
1054
  await executeCall(call, options);
1055
1055
  if (resp === undefined) {
1056
- throw new Error('API call completed without a result.');
1056
+ throw new Error('operation completed without a result.');
1057
1057
  }
1058
1058
  return resp;
1059
1059
  }
@@ -1077,56 +1077,10 @@ export class MarketplacesClient {
1077
1077
  };
1078
1078
  await executeCall(call, options);
1079
1079
  if (resp === undefined) {
1080
- throw new Error('API call completed without a result.');
1080
+ throw new Error('operation completed without a result.');
1081
1081
  }
1082
1082
  return resp;
1083
1083
  }
1084
- /** List listings owned by this provider */
1085
- async getListings(req, options) {
1086
- const url = `${this.host}/api/2.0/marketplace-provider/listings`;
1087
- const params = new URLSearchParams();
1088
- if (req.pageToken !== undefined) {
1089
- params.append('page_token', req.pageToken);
1090
- }
1091
- if (req.pageSize !== undefined) {
1092
- params.append('page_size', String(req.pageSize));
1093
- }
1094
- const query = params.toString();
1095
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1096
- let resp;
1097
- const call = async (callSignal) => {
1098
- const headers = new Headers();
1099
- if (this.workspaceId !== undefined) {
1100
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1101
- }
1102
- headers.set('User-Agent', this.userAgent);
1103
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1104
- const respBody = await executeHttpCall({
1105
- request: httpReq,
1106
- httpClient: this.httpClient,
1107
- logger: this.logger,
1108
- });
1109
- resp = parseResponse(respBody, unmarshalGetListingsRequest_ResponseSchema);
1110
- };
1111
- await executeCall(call, options);
1112
- if (resp === undefined) {
1113
- throw new Error('API call completed without a result.');
1114
- }
1115
- return resp;
1116
- }
1117
- async *getListingsIter(req, options) {
1118
- const pageReq = { ...req };
1119
- for (;;) {
1120
- const resp = await this.getListings(pageReq, options);
1121
- for (const item of resp.listings ?? []) {
1122
- yield item;
1123
- }
1124
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1125
- return;
1126
- }
1127
- pageReq.pageToken = resp.nextPageToken;
1128
- }
1129
- }
1130
1084
  /**
1131
1085
  * List personalization requests to this provider.
1132
1086
  * This will return all personalization requests, regardless of which listing they are for.
@@ -1159,7 +1113,7 @@ export class MarketplacesClient {
1159
1113
  };
1160
1114
  await executeCall(call, options);
1161
1115
  if (resp === undefined) {
1162
- throw new Error('API call completed without a result.');
1116
+ throw new Error('operation completed without a result.');
1163
1117
  }
1164
1118
  return resp;
1165
1119
  }
@@ -1196,7 +1150,7 @@ export class MarketplacesClient {
1196
1150
  };
1197
1151
  await executeCall(call, options);
1198
1152
  if (resp === undefined) {
1199
- throw new Error('API call completed without a result.');
1153
+ throw new Error('operation completed without a result.');
1200
1154
  }
1201
1155
  return resp;
1202
1156
  }
@@ -1232,7 +1186,7 @@ export class MarketplacesClient {
1232
1186
  };
1233
1187
  await executeCall(call, options);
1234
1188
  if (resp === undefined) {
1235
- throw new Error('API call completed without a result.');
1189
+ throw new Error('operation completed without a result.');
1236
1190
  }
1237
1191
  return resp;
1238
1192
  }
@@ -1278,7 +1232,7 @@ export class MarketplacesClient {
1278
1232
  };
1279
1233
  await executeCall(call, options);
1280
1234
  if (resp === undefined) {
1281
- throw new Error('API call completed without a result.');
1235
+ throw new Error('operation completed without a result.');
1282
1236
  }
1283
1237
  return resp;
1284
1238
  }
@@ -1327,7 +1281,7 @@ export class MarketplacesClient {
1327
1281
  };
1328
1282
  await executeCall(call, options);
1329
1283
  if (resp === undefined) {
1330
- throw new Error('API call completed without a result.');
1284
+ throw new Error('operation completed without a result.');
1331
1285
  }
1332
1286
  return resp;
1333
1287
  }
@@ -1376,7 +1330,7 @@ export class MarketplacesClient {
1376
1330
  };
1377
1331
  await executeCall(call, options);
1378
1332
  if (resp === undefined) {
1379
- throw new Error('API call completed without a result.');
1333
+ throw new Error('operation completed without a result.');
1380
1334
  }
1381
1335
  return resp;
1382
1336
  }
@@ -1393,6 +1347,52 @@ export class MarketplacesClient {
1393
1347
  pageReq.pageToken = resp.nextPageToken;
1394
1348
  }
1395
1349
  }
1350
+ /** List listings owned by this provider */
1351
+ async listListings(req, options) {
1352
+ const url = `${this.host}/api/2.0/marketplace-provider/listings`;
1353
+ const params = new URLSearchParams();
1354
+ if (req.pageToken !== undefined) {
1355
+ params.append('page_token', req.pageToken);
1356
+ }
1357
+ if (req.pageSize !== undefined) {
1358
+ params.append('page_size', String(req.pageSize));
1359
+ }
1360
+ const query = params.toString();
1361
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
1362
+ let resp;
1363
+ const call = async (callSignal) => {
1364
+ const headers = new Headers();
1365
+ if (this.workspaceId !== undefined) {
1366
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
1367
+ }
1368
+ headers.set('User-Agent', this.userAgent);
1369
+ const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1370
+ const respBody = await executeHttpCall({
1371
+ request: httpReq,
1372
+ httpClient: this.httpClient,
1373
+ logger: this.logger,
1374
+ });
1375
+ resp = parseResponse(respBody, unmarshalListListingsRequest_ResponseSchema);
1376
+ };
1377
+ await executeCall(call, options);
1378
+ if (resp === undefined) {
1379
+ throw new Error('operation completed without a result.');
1380
+ }
1381
+ return resp;
1382
+ }
1383
+ async *listListingsIter(req, options) {
1384
+ const pageReq = { ...req };
1385
+ for (;;) {
1386
+ const resp = await this.listListings(pageReq, options);
1387
+ for (const item of resp.listings ?? []) {
1388
+ yield item;
1389
+ }
1390
+ if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1391
+ return;
1392
+ }
1393
+ pageReq.pageToken = resp.nextPageToken;
1394
+ }
1395
+ }
1396
1396
  /** List listings associated with an exchange */
1397
1397
  async listListingsForExchange(req, options) {
1398
1398
  const url = `${this.host}/api/2.0/marketplace-exchange/listings-for-exchange`;
@@ -1425,7 +1425,7 @@ export class MarketplacesClient {
1425
1425
  };
1426
1426
  await executeCall(call, options);
1427
1427
  if (resp === undefined) {
1428
- throw new Error('API call completed without a result.');
1428
+ throw new Error('operation completed without a result.');
1429
1429
  }
1430
1430
  return resp;
1431
1431
  }
@@ -1462,7 +1462,7 @@ export class MarketplacesClient {
1462
1462
  };
1463
1463
  await executeCall(call, options);
1464
1464
  if (resp === undefined) {
1465
- throw new Error('API call completed without a result.');
1465
+ throw new Error('operation completed without a result.');
1466
1466
  }
1467
1467
  return resp;
1468
1468
  }
@@ -1495,7 +1495,7 @@ export class MarketplacesClient {
1495
1495
  };
1496
1496
  await executeCall(call, options);
1497
1497
  if (resp === undefined) {
1498
- throw new Error('API call completed without a result.');
1498
+ throw new Error('operation completed without a result.');
1499
1499
  }
1500
1500
  return resp;
1501
1501
  }
@@ -1532,7 +1532,7 @@ export class MarketplacesClient {
1532
1532
  };
1533
1533
  await executeCall(call, options);
1534
1534
  if (resp === undefined) {
1535
- throw new Error('API call completed without a result.');
1535
+ throw new Error('operation completed without a result.');
1536
1536
  }
1537
1537
  return resp;
1538
1538
  }
@@ -1557,7 +1557,7 @@ export class MarketplacesClient {
1557
1557
  };
1558
1558
  await executeCall(call, options);
1559
1559
  if (resp === undefined) {
1560
- throw new Error('API call completed without a result.');
1560
+ throw new Error('operation completed without a result.');
1561
1561
  }
1562
1562
  return resp;
1563
1563
  }
@@ -1582,7 +1582,7 @@ export class MarketplacesClient {
1582
1582
  };
1583
1583
  await executeCall(call, options);
1584
1584
  if (resp === undefined) {
1585
- throw new Error('API call completed without a result.');
1585
+ throw new Error('operation completed without a result.');
1586
1586
  }
1587
1587
  return resp;
1588
1588
  }
@@ -1607,7 +1607,7 @@ export class MarketplacesClient {
1607
1607
  };
1608
1608
  await executeCall(call, options);
1609
1609
  if (resp === undefined) {
1610
- throw new Error('API call completed without a result.');
1610
+ throw new Error('operation completed without a result.');
1611
1611
  }
1612
1612
  return resp;
1613
1613
  }
@@ -1632,7 +1632,7 @@ export class MarketplacesClient {
1632
1632
  };
1633
1633
  await executeCall(call, options);
1634
1634
  if (resp === undefined) {
1635
- throw new Error('API call completed without a result.');
1635
+ throw new Error('operation completed without a result.');
1636
1636
  }
1637
1637
  return resp;
1638
1638
  }
@@ -1657,7 +1657,7 @@ export class MarketplacesClient {
1657
1657
  };
1658
1658
  await executeCall(call, options);
1659
1659
  if (resp === undefined) {
1660
- throw new Error('API call completed without a result.');
1660
+ throw new Error('operation completed without a result.');
1661
1661
  }
1662
1662
  return resp;
1663
1663
  }
@@ -1682,7 +1682,7 @@ export class MarketplacesClient {
1682
1682
  };
1683
1683
  await executeCall(call, options);
1684
1684
  if (resp === undefined) {
1685
- throw new Error('API call completed without a result.');
1685
+ throw new Error('operation completed without a result.');
1686
1686
  }
1687
1687
  return resp;
1688
1688
  }