@databricks/sdk-marketplaces 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/dist/v1/client.d.ts +48 -48
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +242 -242
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/model.d.ts +118 -118
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +71 -106
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/utils.d.ts +1 -2
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +1 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +6 -5
- package/src/v1/client.ts +478 -511
- package/src/v1/index.ts +40 -40
- package/src/v1/model.ts +184 -252
- package/src/v1/utils.ts +3 -3
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,
|
|
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, unmarshalCreateFileResponseSchema, unmarshalCreateInstallationResponseSchema, unmarshalCreateListingResponseSchema, unmarshalCreatePersonalizationResponseSchema, unmarshalCreateProviderAnalyticsDashboardResponseSchema, unmarshalCreateProviderResponseSchema, unmarshalDeleteExchangeFilterResponseSchema, unmarshalDeleteExchangeResponseSchema, unmarshalDeleteFileResponseSchema, unmarshalDeleteInstallationResponseSchema, unmarshalDeleteListingResponseSchema, unmarshalDeleteProviderResponseSchema, unmarshalGetAllPersonalizationRequestsForConsumerResponseSchema, unmarshalGetExchangeResponseSchema, unmarshalGetFileResponseSchema, unmarshalGetLatestVersionProviderAnalyticsDashboardResponseSchema, unmarshalGetListingContentMetadataResponseSchema, unmarshalGetListingResponseSchema, unmarshalGetListingsResponseSchema, unmarshalGetPersonalizationRequestsForConsumerResponseSchema, unmarshalGetPersonalizationRequestsForProviderResponseSchema, unmarshalGetProviderResponseSchema, unmarshalGetPublishedListingForConsumerResponseSchema, unmarshalGetPublishedListingsForConsumerResponseSchema, unmarshalGetPublishedProviderForConsumerResponseSchema, unmarshalListAllInstallationsResponseSchema, unmarshalListExchangeFiltersResponseSchema, unmarshalListExchangesForListingResponseSchema, unmarshalListExchangesResponseSchema, unmarshalListFilesResponseSchema, unmarshalListFulfillmentsResponseSchema, unmarshalListInstallationsResponseSchema, unmarshalListListingsForExchangeResponseSchema, unmarshalListProviderAnalyticsDashboardResponseSchema, unmarshalListProvidersResponseSchema, unmarshalListPublishedProvidersForConsumerResponseSchema, unmarshalRemoveExchangeForListingResponseSchema, unmarshalSearchPublishedListingsForConsumerResponseSchema, unmarshalUpdateExchangeFilterResponseSchema, unmarshalUpdateExchangeResponseSchema, unmarshalUpdateInstallationResponseSchema, unmarshalUpdateListingResponseSchema, unmarshalUpdatePersonalizationRequestStatusResponseSchema, unmarshalUpdateProviderAnalyticsDashboardResponseSchema, unmarshalUpdateProviderResponseSchema, } 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('
|
|
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('
|
|
96
|
+
throw new Error('operation completed without a result.');
|
|
97
97
|
}
|
|
98
98
|
return resp;
|
|
99
99
|
}
|
|
@@ -114,17 +114,17 @@ export class MarketplacesClient {
|
|
|
114
114
|
httpClient: this.httpClient,
|
|
115
115
|
logger: this.logger,
|
|
116
116
|
});
|
|
117
|
-
resp = parseResponse(respBody,
|
|
117
|
+
resp = parseResponse(respBody, unmarshalCreatePersonalizationResponseSchema);
|
|
118
118
|
};
|
|
119
119
|
await executeCall(call, options);
|
|
120
120
|
if (resp === undefined) {
|
|
121
|
-
throw new Error('
|
|
121
|
+
throw new Error('operation completed without a result.');
|
|
122
122
|
}
|
|
123
123
|
return resp;
|
|
124
124
|
}
|
|
125
|
-
/** List all installations
|
|
126
|
-
async
|
|
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,
|
|
150
|
+
resp = parseResponse(respBody, unmarshalListInstallationsResponseSchema);
|
|
151
151
|
};
|
|
152
152
|
await executeCall(call, options);
|
|
153
153
|
if (resp === undefined) {
|
|
154
|
-
throw new Error('
|
|
154
|
+
throw new Error('operation completed without a result.');
|
|
155
155
|
}
|
|
156
156
|
return resp;
|
|
157
157
|
}
|
|
158
|
-
async *
|
|
158
|
+
async *getInstallationDetailsIter(req, options) {
|
|
159
159
|
const pageReq = { ...req };
|
|
160
160
|
for (;;) {
|
|
161
|
-
const resp = await this.
|
|
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
|
-
/**
|
|
172
|
-
async
|
|
173
|
-
const url = `${this.host}/api/2.0/marketplace-consumer/
|
|
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,
|
|
196
|
+
resp = parseResponse(respBody, unmarshalGetListingContentMetadataResponseSchema);
|
|
197
197
|
};
|
|
198
198
|
await executeCall(call, options);
|
|
199
199
|
if (resp === undefined) {
|
|
200
|
-
throw new Error('
|
|
200
|
+
throw new Error('operation completed without a result.');
|
|
201
201
|
}
|
|
202
202
|
return resp;
|
|
203
203
|
}
|
|
204
|
-
async *
|
|
204
|
+
async *getListingContentIter(req, options) {
|
|
205
205
|
const pageReq = { ...req };
|
|
206
206
|
for (;;) {
|
|
207
|
-
const resp = await this.
|
|
208
|
-
for (const item of resp.
|
|
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
|
-
/**
|
|
218
|
-
async
|
|
219
|
-
const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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, unmarshalGetPersonalizationRequestsForConsumerResponseSchema);
|
|
234
|
+
};
|
|
235
|
+
await executeCall(call, options);
|
|
236
|
+
if (resp === undefined) {
|
|
237
|
+
throw new Error('operation completed without a result.');
|
|
226
238
|
}
|
|
227
|
-
|
|
228
|
-
|
|
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',
|
|
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,
|
|
257
|
+
resp = parseResponse(respBody, unmarshalGetPublishedListingForConsumerResponseSchema);
|
|
243
258
|
};
|
|
244
259
|
await executeCall(call, options);
|
|
245
260
|
if (resp === undefined) {
|
|
246
|
-
throw new Error('
|
|
261
|
+
throw new Error('operation completed without a result.');
|
|
247
262
|
}
|
|
248
263
|
return resp;
|
|
249
264
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
258
|
-
|
|
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, unmarshalGetPublishedProviderForConsumerResponseSchema);
|
|
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
|
-
|
|
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, unmarshalCreateInstallationResponseSchema);
|
|
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
|
-
/**
|
|
264
|
-
async
|
|
265
|
-
const url = `${this.host}/api/2.0/marketplace-consumer/
|
|
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,
|
|
339
|
+
resp = parseResponse(respBody, unmarshalListAllInstallationsResponseSchema);
|
|
289
340
|
};
|
|
290
341
|
await executeCall(call, options);
|
|
291
342
|
if (resp === undefined) {
|
|
292
|
-
throw new Error('
|
|
343
|
+
throw new Error('operation completed without a result.');
|
|
293
344
|
}
|
|
294
345
|
return resp;
|
|
295
346
|
}
|
|
296
|
-
async *
|
|
347
|
+
async *listInstallationsIter(req, options) {
|
|
297
348
|
const pageReq = { ...req };
|
|
298
349
|
for (;;) {
|
|
299
|
-
const resp = await this.
|
|
300
|
-
for (const item of resp.
|
|
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
|
|
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,
|
|
389
|
+
resp = parseResponse(respBody, unmarshalListFulfillmentsResponseSchema);
|
|
339
390
|
};
|
|
340
391
|
await executeCall(call, options);
|
|
341
392
|
if (resp === undefined) {
|
|
342
|
-
throw new Error('
|
|
393
|
+
throw new Error('operation completed without a result.');
|
|
343
394
|
}
|
|
344
395
|
return resp;
|
|
345
396
|
}
|
|
346
|
-
async *
|
|
397
|
+
async *listListingFulfillmentsIter(req, options) {
|
|
347
398
|
const pageReq = { ...req };
|
|
348
399
|
for (;;) {
|
|
349
|
-
const resp = await this.
|
|
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
|
-
/**
|
|
360
|
-
async
|
|
361
|
-
const url = `${this.host}/api/2.0/marketplace-consumer/
|
|
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',
|
|
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,
|
|
435
|
+
resp = parseResponse(respBody, unmarshalGetAllPersonalizationRequestsForConsumerResponseSchema);
|
|
376
436
|
};
|
|
377
437
|
await executeCall(call, options);
|
|
378
438
|
if (resp === undefined) {
|
|
379
|
-
throw new Error('
|
|
439
|
+
throw new Error('operation completed without a result.');
|
|
380
440
|
}
|
|
381
441
|
return resp;
|
|
382
442
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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
|
|
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,
|
|
502
|
+
resp = parseResponse(respBody, unmarshalGetPublishedListingsForConsumerResponseSchema);
|
|
454
503
|
};
|
|
455
504
|
await executeCall(call, options);
|
|
456
505
|
if (resp === undefined) {
|
|
457
|
-
throw new Error('
|
|
506
|
+
throw new Error('operation completed without a result.');
|
|
458
507
|
}
|
|
459
508
|
return resp;
|
|
460
509
|
}
|
|
461
|
-
async *
|
|
510
|
+
async *listPublishedListingsForConsumerIter(req, options) {
|
|
462
511
|
const pageReq = { ...req };
|
|
463
512
|
for (;;) {
|
|
464
|
-
const resp = await this.
|
|
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`;
|
|
@@ -548,11 +548,11 @@ export class MarketplacesClient {
|
|
|
548
548
|
httpClient: this.httpClient,
|
|
549
549
|
logger: this.logger,
|
|
550
550
|
});
|
|
551
|
-
resp = parseResponse(respBody,
|
|
551
|
+
resp = parseResponse(respBody, unmarshalListPublishedProvidersForConsumerResponseSchema);
|
|
552
552
|
};
|
|
553
553
|
await executeCall(call, options);
|
|
554
554
|
if (resp === undefined) {
|
|
555
|
-
throw new Error('
|
|
555
|
+
throw new Error('operation completed without a result.');
|
|
556
556
|
}
|
|
557
557
|
return resp;
|
|
558
558
|
}
|
|
@@ -615,11 +615,11 @@ export class MarketplacesClient {
|
|
|
615
615
|
httpClient: this.httpClient,
|
|
616
616
|
logger: this.logger,
|
|
617
617
|
});
|
|
618
|
-
resp = parseResponse(respBody,
|
|
618
|
+
resp = parseResponse(respBody, unmarshalSearchPublishedListingsForConsumerResponseSchema);
|
|
619
619
|
};
|
|
620
620
|
await executeCall(call, options);
|
|
621
621
|
if (resp === undefined) {
|
|
622
|
-
throw new Error('
|
|
622
|
+
throw new Error('operation completed without a result.');
|
|
623
623
|
}
|
|
624
624
|
return resp;
|
|
625
625
|
}
|
|
@@ -652,11 +652,11 @@ export class MarketplacesClient {
|
|
|
652
652
|
httpClient: this.httpClient,
|
|
653
653
|
logger: this.logger,
|
|
654
654
|
});
|
|
655
|
-
resp = parseResponse(respBody,
|
|
655
|
+
resp = parseResponse(respBody, unmarshalDeleteInstallationResponseSchema);
|
|
656
656
|
};
|
|
657
657
|
await executeCall(call, options);
|
|
658
658
|
if (resp === undefined) {
|
|
659
|
-
throw new Error('
|
|
659
|
+
throw new Error('operation completed without a result.');
|
|
660
660
|
}
|
|
661
661
|
return resp;
|
|
662
662
|
}
|
|
@@ -682,11 +682,11 @@ export class MarketplacesClient {
|
|
|
682
682
|
httpClient: this.httpClient,
|
|
683
683
|
logger: this.logger,
|
|
684
684
|
});
|
|
685
|
-
resp = parseResponse(respBody,
|
|
685
|
+
resp = parseResponse(respBody, unmarshalUpdateInstallationResponseSchema);
|
|
686
686
|
};
|
|
687
687
|
await executeCall(call, options);
|
|
688
688
|
if (resp === undefined) {
|
|
689
|
-
throw new Error('
|
|
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('
|
|
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('
|
|
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('
|
|
764
|
+
throw new Error('operation completed without a result.');
|
|
765
765
|
}
|
|
766
766
|
return resp;
|
|
767
767
|
}
|
|
@@ -782,11 +782,11 @@ export class MarketplacesClient {
|
|
|
782
782
|
httpClient: this.httpClient,
|
|
783
783
|
logger: this.logger,
|
|
784
784
|
});
|
|
785
|
-
resp = parseResponse(respBody,
|
|
785
|
+
resp = parseResponse(respBody, unmarshalCreateFileResponseSchema);
|
|
786
786
|
};
|
|
787
787
|
await executeCall(call, options);
|
|
788
788
|
if (resp === undefined) {
|
|
789
|
-
throw new Error('
|
|
789
|
+
throw new Error('operation completed without a result.');
|
|
790
790
|
}
|
|
791
791
|
return resp;
|
|
792
792
|
}
|
|
@@ -807,11 +807,11 @@ export class MarketplacesClient {
|
|
|
807
807
|
httpClient: this.httpClient,
|
|
808
808
|
logger: this.logger,
|
|
809
809
|
});
|
|
810
|
-
resp = parseResponse(respBody,
|
|
810
|
+
resp = parseResponse(respBody, unmarshalCreateListingResponseSchema);
|
|
811
811
|
};
|
|
812
812
|
await executeCall(call, options);
|
|
813
813
|
if (resp === undefined) {
|
|
814
|
-
throw new Error('
|
|
814
|
+
throw new Error('operation completed without a result.');
|
|
815
815
|
}
|
|
816
816
|
return resp;
|
|
817
817
|
}
|
|
@@ -832,11 +832,11 @@ export class MarketplacesClient {
|
|
|
832
832
|
httpClient: this.httpClient,
|
|
833
833
|
logger: this.logger,
|
|
834
834
|
});
|
|
835
|
-
resp = parseResponse(respBody,
|
|
835
|
+
resp = parseResponse(respBody, unmarshalCreateProviderResponseSchema);
|
|
836
836
|
};
|
|
837
837
|
await executeCall(call, options);
|
|
838
838
|
if (resp === undefined) {
|
|
839
|
-
throw new Error('
|
|
839
|
+
throw new Error('operation completed without a result.');
|
|
840
840
|
}
|
|
841
841
|
return resp;
|
|
842
842
|
}
|
|
@@ -857,11 +857,11 @@ export class MarketplacesClient {
|
|
|
857
857
|
httpClient: this.httpClient,
|
|
858
858
|
logger: this.logger,
|
|
859
859
|
});
|
|
860
|
-
resp = parseResponse(respBody,
|
|
860
|
+
resp = parseResponse(respBody, unmarshalCreateProviderAnalyticsDashboardResponseSchema);
|
|
861
861
|
};
|
|
862
862
|
await executeCall(call, options);
|
|
863
863
|
if (resp === undefined) {
|
|
864
|
-
throw new Error('
|
|
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('
|
|
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('
|
|
912
|
+
throw new Error('operation completed without a result.');
|
|
913
913
|
}
|
|
914
914
|
return resp;
|
|
915
915
|
}
|
|
@@ -929,11 +929,11 @@ export class MarketplacesClient {
|
|
|
929
929
|
httpClient: this.httpClient,
|
|
930
930
|
logger: this.logger,
|
|
931
931
|
});
|
|
932
|
-
resp = parseResponse(respBody,
|
|
932
|
+
resp = parseResponse(respBody, unmarshalDeleteFileResponseSchema);
|
|
933
933
|
};
|
|
934
934
|
await executeCall(call, options);
|
|
935
935
|
if (resp === undefined) {
|
|
936
|
-
throw new Error('
|
|
936
|
+
throw new Error('operation completed without a result.');
|
|
937
937
|
}
|
|
938
938
|
return resp;
|
|
939
939
|
}
|
|
@@ -953,11 +953,11 @@ export class MarketplacesClient {
|
|
|
953
953
|
httpClient: this.httpClient,
|
|
954
954
|
logger: this.logger,
|
|
955
955
|
});
|
|
956
|
-
resp = parseResponse(respBody,
|
|
956
|
+
resp = parseResponse(respBody, unmarshalDeleteListingResponseSchema);
|
|
957
957
|
};
|
|
958
958
|
await executeCall(call, options);
|
|
959
959
|
if (resp === undefined) {
|
|
960
|
-
throw new Error('
|
|
960
|
+
throw new Error('operation completed without a result.');
|
|
961
961
|
}
|
|
962
962
|
return resp;
|
|
963
963
|
}
|
|
@@ -977,11 +977,11 @@ export class MarketplacesClient {
|
|
|
977
977
|
httpClient: this.httpClient,
|
|
978
978
|
logger: this.logger,
|
|
979
979
|
});
|
|
980
|
-
resp = parseResponse(respBody,
|
|
980
|
+
resp = parseResponse(respBody, unmarshalDeleteProviderResponseSchema);
|
|
981
981
|
};
|
|
982
982
|
await executeCall(call, options);
|
|
983
983
|
if (resp === undefined) {
|
|
984
|
-
throw new Error('
|
|
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('
|
|
1008
|
+
throw new Error('operation completed without a result.');
|
|
1009
1009
|
}
|
|
1010
1010
|
return resp;
|
|
1011
1011
|
}
|
|
@@ -1025,11 +1025,11 @@ export class MarketplacesClient {
|
|
|
1025
1025
|
httpClient: this.httpClient,
|
|
1026
1026
|
logger: this.logger,
|
|
1027
1027
|
});
|
|
1028
|
-
resp = parseResponse(respBody,
|
|
1028
|
+
resp = parseResponse(respBody, unmarshalGetFileResponseSchema);
|
|
1029
1029
|
};
|
|
1030
1030
|
await executeCall(call, options);
|
|
1031
1031
|
if (resp === undefined) {
|
|
1032
|
-
throw new Error('
|
|
1032
|
+
throw new Error('operation completed without a result.');
|
|
1033
1033
|
}
|
|
1034
1034
|
return resp;
|
|
1035
1035
|
}
|
|
@@ -1049,11 +1049,11 @@ export class MarketplacesClient {
|
|
|
1049
1049
|
httpClient: this.httpClient,
|
|
1050
1050
|
logger: this.logger,
|
|
1051
1051
|
});
|
|
1052
|
-
resp = parseResponse(respBody,
|
|
1052
|
+
resp = parseResponse(respBody, unmarshalGetLatestVersionProviderAnalyticsDashboardResponseSchema);
|
|
1053
1053
|
};
|
|
1054
1054
|
await executeCall(call, options);
|
|
1055
1055
|
if (resp === undefined) {
|
|
1056
|
-
throw new Error('
|
|
1056
|
+
throw new Error('operation completed without a result.');
|
|
1057
1057
|
}
|
|
1058
1058
|
return resp;
|
|
1059
1059
|
}
|
|
@@ -1073,60 +1073,14 @@ export class MarketplacesClient {
|
|
|
1073
1073
|
httpClient: this.httpClient,
|
|
1074
1074
|
logger: this.logger,
|
|
1075
1075
|
});
|
|
1076
|
-
resp = parseResponse(respBody,
|
|
1076
|
+
resp = parseResponse(respBody, unmarshalGetListingResponseSchema);
|
|
1077
1077
|
};
|
|
1078
1078
|
await executeCall(call, options);
|
|
1079
1079
|
if (resp === undefined) {
|
|
1080
|
-
throw new Error('
|
|
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.
|
|
@@ -1155,11 +1109,11 @@ export class MarketplacesClient {
|
|
|
1155
1109
|
httpClient: this.httpClient,
|
|
1156
1110
|
logger: this.logger,
|
|
1157
1111
|
});
|
|
1158
|
-
resp = parseResponse(respBody,
|
|
1112
|
+
resp = parseResponse(respBody, unmarshalGetPersonalizationRequestsForProviderResponseSchema);
|
|
1159
1113
|
};
|
|
1160
1114
|
await executeCall(call, options);
|
|
1161
1115
|
if (resp === undefined) {
|
|
1162
|
-
throw new Error('
|
|
1116
|
+
throw new Error('operation completed without a result.');
|
|
1163
1117
|
}
|
|
1164
1118
|
return resp;
|
|
1165
1119
|
}
|
|
@@ -1192,11 +1146,11 @@ export class MarketplacesClient {
|
|
|
1192
1146
|
httpClient: this.httpClient,
|
|
1193
1147
|
logger: this.logger,
|
|
1194
1148
|
});
|
|
1195
|
-
resp = parseResponse(respBody,
|
|
1149
|
+
resp = parseResponse(respBody, unmarshalGetProviderResponseSchema);
|
|
1196
1150
|
};
|
|
1197
1151
|
await executeCall(call, options);
|
|
1198
1152
|
if (resp === undefined) {
|
|
1199
|
-
throw new Error('
|
|
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('
|
|
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('
|
|
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('
|
|
1284
|
+
throw new Error('operation completed without a result.');
|
|
1331
1285
|
}
|
|
1332
1286
|
return resp;
|
|
1333
1287
|
}
|
|
@@ -1372,11 +1326,11 @@ export class MarketplacesClient {
|
|
|
1372
1326
|
httpClient: this.httpClient,
|
|
1373
1327
|
logger: this.logger,
|
|
1374
1328
|
});
|
|
1375
|
-
resp = parseResponse(respBody,
|
|
1329
|
+
resp = parseResponse(respBody, unmarshalListFilesResponseSchema);
|
|
1376
1330
|
};
|
|
1377
1331
|
await executeCall(call, options);
|
|
1378
1332
|
if (resp === undefined) {
|
|
1379
|
-
throw new Error('
|
|
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, unmarshalGetListingsResponseSchema);
|
|
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('
|
|
1428
|
+
throw new Error('operation completed without a result.');
|
|
1429
1429
|
}
|
|
1430
1430
|
return resp;
|
|
1431
1431
|
}
|
|
@@ -1458,11 +1458,11 @@ export class MarketplacesClient {
|
|
|
1458
1458
|
httpClient: this.httpClient,
|
|
1459
1459
|
logger: this.logger,
|
|
1460
1460
|
});
|
|
1461
|
-
resp = parseResponse(respBody,
|
|
1461
|
+
resp = parseResponse(respBody, unmarshalListProviderAnalyticsDashboardResponseSchema);
|
|
1462
1462
|
};
|
|
1463
1463
|
await executeCall(call, options);
|
|
1464
1464
|
if (resp === undefined) {
|
|
1465
|
-
throw new Error('
|
|
1465
|
+
throw new Error('operation completed without a result.');
|
|
1466
1466
|
}
|
|
1467
1467
|
return resp;
|
|
1468
1468
|
}
|
|
@@ -1491,11 +1491,11 @@ export class MarketplacesClient {
|
|
|
1491
1491
|
httpClient: this.httpClient,
|
|
1492
1492
|
logger: this.logger,
|
|
1493
1493
|
});
|
|
1494
|
-
resp = parseResponse(respBody,
|
|
1494
|
+
resp = parseResponse(respBody, unmarshalListProvidersResponseSchema);
|
|
1495
1495
|
};
|
|
1496
1496
|
await executeCall(call, options);
|
|
1497
1497
|
if (resp === undefined) {
|
|
1498
|
-
throw new Error('
|
|
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('
|
|
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('
|
|
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('
|
|
1585
|
+
throw new Error('operation completed without a result.');
|
|
1586
1586
|
}
|
|
1587
1587
|
return resp;
|
|
1588
1588
|
}
|
|
@@ -1603,11 +1603,11 @@ export class MarketplacesClient {
|
|
|
1603
1603
|
httpClient: this.httpClient,
|
|
1604
1604
|
logger: this.logger,
|
|
1605
1605
|
});
|
|
1606
|
-
resp = parseResponse(respBody,
|
|
1606
|
+
resp = parseResponse(respBody, unmarshalUpdateListingResponseSchema);
|
|
1607
1607
|
};
|
|
1608
1608
|
await executeCall(call, options);
|
|
1609
1609
|
if (resp === undefined) {
|
|
1610
|
-
throw new Error('
|
|
1610
|
+
throw new Error('operation completed without a result.');
|
|
1611
1611
|
}
|
|
1612
1612
|
return resp;
|
|
1613
1613
|
}
|
|
@@ -1628,11 +1628,11 @@ export class MarketplacesClient {
|
|
|
1628
1628
|
httpClient: this.httpClient,
|
|
1629
1629
|
logger: this.logger,
|
|
1630
1630
|
});
|
|
1631
|
-
resp = parseResponse(respBody,
|
|
1631
|
+
resp = parseResponse(respBody, unmarshalUpdatePersonalizationRequestStatusResponseSchema);
|
|
1632
1632
|
};
|
|
1633
1633
|
await executeCall(call, options);
|
|
1634
1634
|
if (resp === undefined) {
|
|
1635
|
-
throw new Error('
|
|
1635
|
+
throw new Error('operation completed without a result.');
|
|
1636
1636
|
}
|
|
1637
1637
|
return resp;
|
|
1638
1638
|
}
|
|
@@ -1653,11 +1653,11 @@ export class MarketplacesClient {
|
|
|
1653
1653
|
httpClient: this.httpClient,
|
|
1654
1654
|
logger: this.logger,
|
|
1655
1655
|
});
|
|
1656
|
-
resp = parseResponse(respBody,
|
|
1656
|
+
resp = parseResponse(respBody, unmarshalUpdateProviderResponseSchema);
|
|
1657
1657
|
};
|
|
1658
1658
|
await executeCall(call, options);
|
|
1659
1659
|
if (resp === undefined) {
|
|
1660
|
-
throw new Error('
|
|
1660
|
+
throw new Error('operation completed without a result.');
|
|
1661
1661
|
}
|
|
1662
1662
|
return resp;
|
|
1663
1663
|
}
|
|
@@ -1678,11 +1678,11 @@ export class MarketplacesClient {
|
|
|
1678
1678
|
httpClient: this.httpClient,
|
|
1679
1679
|
logger: this.logger,
|
|
1680
1680
|
});
|
|
1681
|
-
resp = parseResponse(respBody,
|
|
1681
|
+
resp = parseResponse(respBody, unmarshalUpdateProviderAnalyticsDashboardResponseSchema);
|
|
1682
1682
|
};
|
|
1683
1683
|
await executeCall(call, options);
|
|
1684
1684
|
if (resp === undefined) {
|
|
1685
|
-
throw new Error('
|
|
1685
|
+
throw new Error('operation completed without a result.');
|
|
1686
1686
|
}
|
|
1687
1687
|
return resp;
|
|
1688
1688
|
}
|