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

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 DELETED
@@ -1,2290 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
4
- import {createDefault} from '@databricks/sdk-core/clientinfo';
5
- import type {Logger} from '@databricks/sdk-core/logger';
6
- import {NoOpLogger} from '@databricks/sdk-core/logger';
7
- import type {CallOptions} from '@databricks/sdk-options/call';
8
- import type {ClientOptions} from '@databricks/sdk-options/client';
9
- import type {HttpClient} from '@databricks/sdk-core/http';
10
- import {newHttpClient} from './transport';
11
- import {
12
- buildHttpRequest,
13
- executeCall,
14
- executeHttpCall,
15
- marshalRequest,
16
- parseResponse,
17
- flattenQueryParams,
18
- } from './utils';
19
- import pkgJson from '../../package.json' with {type: 'json'};
20
- import type {
21
- AddExchangeForListingRequest,
22
- AddExchangeForListingResponse,
23
- BatchGetListingsRequest,
24
- BatchGetListingsResponse,
25
- BatchGetProvidersRequest,
26
- BatchGetProvidersResponse,
27
- CreateExchangeFilterRequest,
28
- CreateExchangeFilterResponse,
29
- CreateExchangeRequest,
30
- CreateExchangeResponse,
31
- CreateFileRequest,
32
- CreateFileRequest_Response,
33
- CreateListingRequest,
34
- CreateListingRequest_Response,
35
- CreatePersonalizationRequest,
36
- CreatePersonalizationRequest_Response,
37
- CreateProviderAnalyticsDashboardRequest,
38
- CreateProviderAnalyticsDashboardRequest_Response,
39
- CreateProviderRequest,
40
- CreateProviderRequest_Response,
41
- DeleteExchangeFilterRequest,
42
- DeleteExchangeFilterResponse,
43
- DeleteExchangeRequest,
44
- DeleteExchangeResponse,
45
- DeleteFileRequest,
46
- DeleteFileRequest_Response,
47
- DeleteListingRequest,
48
- DeleteListingRequest_Response,
49
- DeleteProviderRequest,
50
- DeleteProviderRequest_Response,
51
- Exchange,
52
- ExchangeFilter,
53
- ExchangeListing,
54
- FileInfo,
55
- GetExchangeRequest,
56
- GetExchangeResponse,
57
- GetFileRequest,
58
- GetFileRequest_Response,
59
- GetInstallationDetails,
60
- GetInstallationDetails_Response,
61
- GetLatestVersionProviderAnalyticsDashboardRequest,
62
- GetLatestVersionProviderAnalyticsDashboardRequest_Response,
63
- GetListingContent,
64
- GetListingContent_Response,
65
- GetListingRequest,
66
- GetListingRequest_Response,
67
- GetPersonalizationRequestsForConsumer,
68
- GetPersonalizationRequestsForConsumer_Response,
69
- GetPersonalizationRequestsForProviderRequest,
70
- GetPersonalizationRequestsForProviderRequest_Response,
71
- GetProviderRequest,
72
- GetProviderRequest_Response,
73
- GetPublishedListingForConsumer,
74
- GetPublishedListingForConsumer_Response,
75
- GetPublishedProviderForConsumer,
76
- GetPublishedProviderForConsumer_Response,
77
- InstallListing,
78
- InstallListing_Response,
79
- InstallationDetail,
80
- ListExchangeFiltersRequest,
81
- ListExchangeFiltersResponse,
82
- ListExchangesForListingRequest,
83
- ListExchangesForListingResponse,
84
- ListExchangesRequest,
85
- ListExchangesResponse,
86
- ListFilesRequest,
87
- ListFilesRequest_Response,
88
- ListInstallationsRequest,
89
- ListInstallationsRequest_Response,
90
- ListListingFulfillmentsRequest,
91
- ListListingFulfillmentsRequest_Response,
92
- ListListingsForExchangeRequest,
93
- ListListingsForExchangeResponse,
94
- ListListingsRequest,
95
- ListListingsRequest_Response,
96
- ListPersonalizationRequestsForConsumerRequest,
97
- ListPersonalizationRequestsForConsumerRequest_Response,
98
- ListProviderAnalyticsDashboardRequest,
99
- ListProviderAnalyticsDashboardRequest_Response,
100
- ListProvidersRequest,
101
- ListProvidersRequest_Response,
102
- ListPublishedListingsForConsumerRequest,
103
- ListPublishedListingsForConsumerRequest_Response,
104
- ListPublishedProvidersForConsumer,
105
- ListPublishedProvidersForConsumer_Response,
106
- Listing,
107
- ListingFulfillment,
108
- PersonalizationRequest,
109
- ProviderInfo,
110
- RemoveExchangeForListingRequest,
111
- RemoveExchangeForListingResponse,
112
- SearchPublishedListingsForConsumer,
113
- SearchPublishedListingsForConsumer_Response,
114
- SharedDataObject,
115
- UninstallListing,
116
- UninstallListing_Response,
117
- UpdateExchangeFilterRequest,
118
- UpdateExchangeFilterResponse,
119
- UpdateExchangeRequest,
120
- UpdateExchangeResponse,
121
- UpdateInstallationDetail,
122
- UpdateInstallationDetail_Response,
123
- UpdateListingRequest,
124
- UpdateListingRequest_Response,
125
- UpdatePersonalizationRequestStatusRequest,
126
- UpdatePersonalizationRequestStatusRequest_Response,
127
- UpdateProviderAnalyticsDashboardRequest,
128
- UpdateProviderAnalyticsDashboardRequest_Response,
129
- UpdateProviderRequest,
130
- UpdateProviderRequest_Response,
131
- } from './model';
132
- import {
133
- marshalAddExchangeForListingRequestSchema,
134
- marshalCreateExchangeFilterRequestSchema,
135
- marshalCreateExchangeRequestSchema,
136
- marshalCreateFileRequestSchema,
137
- marshalCreateListingRequestSchema,
138
- marshalCreatePersonalizationRequestSchema,
139
- marshalCreateProviderAnalyticsDashboardRequestSchema,
140
- marshalCreateProviderRequestSchema,
141
- marshalFileParentSchema,
142
- marshalInstallListingSchema,
143
- marshalListingTagSchema,
144
- marshalUpdateExchangeFilterRequestSchema,
145
- marshalUpdateExchangeRequestSchema,
146
- marshalUpdateInstallationDetailSchema,
147
- marshalUpdateListingRequestSchema,
148
- marshalUpdatePersonalizationRequestStatusRequestSchema,
149
- marshalUpdateProviderAnalyticsDashboardRequestSchema,
150
- marshalUpdateProviderRequestSchema,
151
- unmarshalAddExchangeForListingResponseSchema,
152
- unmarshalBatchGetListingsResponseSchema,
153
- unmarshalBatchGetProvidersResponseSchema,
154
- unmarshalCreateExchangeFilterResponseSchema,
155
- unmarshalCreateExchangeResponseSchema,
156
- unmarshalCreateFileRequest_ResponseSchema,
157
- unmarshalCreateListingRequest_ResponseSchema,
158
- unmarshalCreatePersonalizationRequest_ResponseSchema,
159
- unmarshalCreateProviderAnalyticsDashboardRequest_ResponseSchema,
160
- unmarshalCreateProviderRequest_ResponseSchema,
161
- unmarshalDeleteExchangeFilterResponseSchema,
162
- unmarshalDeleteExchangeResponseSchema,
163
- unmarshalDeleteFileRequest_ResponseSchema,
164
- unmarshalDeleteListingRequest_ResponseSchema,
165
- unmarshalDeleteProviderRequest_ResponseSchema,
166
- unmarshalGetExchangeResponseSchema,
167
- unmarshalGetFileRequest_ResponseSchema,
168
- unmarshalGetInstallationDetails_ResponseSchema,
169
- unmarshalGetLatestVersionProviderAnalyticsDashboardRequest_ResponseSchema,
170
- unmarshalGetListingContent_ResponseSchema,
171
- unmarshalGetListingRequest_ResponseSchema,
172
- unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema,
173
- unmarshalGetPersonalizationRequestsForProviderRequest_ResponseSchema,
174
- unmarshalGetProviderRequest_ResponseSchema,
175
- unmarshalGetPublishedListingForConsumer_ResponseSchema,
176
- unmarshalGetPublishedProviderForConsumer_ResponseSchema,
177
- unmarshalInstallListing_ResponseSchema,
178
- unmarshalListExchangeFiltersResponseSchema,
179
- unmarshalListExchangesForListingResponseSchema,
180
- unmarshalListExchangesResponseSchema,
181
- unmarshalListFilesRequest_ResponseSchema,
182
- unmarshalListInstallationsRequest_ResponseSchema,
183
- unmarshalListListingFulfillmentsRequest_ResponseSchema,
184
- unmarshalListListingsForExchangeResponseSchema,
185
- unmarshalListListingsRequest_ResponseSchema,
186
- unmarshalListPersonalizationRequestsForConsumerRequest_ResponseSchema,
187
- unmarshalListProviderAnalyticsDashboardRequest_ResponseSchema,
188
- unmarshalListProvidersRequest_ResponseSchema,
189
- unmarshalListPublishedListingsForConsumerRequest_ResponseSchema,
190
- unmarshalListPublishedProvidersForConsumer_ResponseSchema,
191
- unmarshalRemoveExchangeForListingResponseSchema,
192
- unmarshalSearchPublishedListingsForConsumer_ResponseSchema,
193
- unmarshalUninstallListing_ResponseSchema,
194
- unmarshalUpdateExchangeFilterResponseSchema,
195
- unmarshalUpdateExchangeResponseSchema,
196
- unmarshalUpdateInstallationDetail_ResponseSchema,
197
- unmarshalUpdateListingRequest_ResponseSchema,
198
- unmarshalUpdatePersonalizationRequestStatusRequest_ResponseSchema,
199
- unmarshalUpdateProviderAnalyticsDashboardRequest_ResponseSchema,
200
- unmarshalUpdateProviderRequest_ResponseSchema,
201
- } from './model';
202
-
203
- // Package identity segment for this client to be used in the User-Agent header.
204
- const PACKAGE_SEGMENT = {
205
- key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
206
- value: pkgJson.version,
207
- };
208
-
209
- export class MarketplacesClient {
210
- private readonly host: string;
211
- // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
212
- // When set, workspace-level methods send X-Databricks-Org-Id on every
213
- // request.
214
- private readonly workspaceId: string | undefined;
215
- private readonly httpClient: HttpClient;
216
- private readonly logger: Logger;
217
- // User-Agent header value. Composed once at construction from
218
- // createDefault() merged with this package's identity and the active
219
- // credential's name.
220
- private readonly userAgent: string;
221
-
222
- constructor(options: ClientOptions) {
223
- if (options.host === undefined) {
224
- throw new Error('Host is required.');
225
- }
226
- this.host = options.host.replace(/\/$/, '');
227
- this.workspaceId = options.workspaceId;
228
- this.logger = options.logger ?? new NoOpLogger();
229
- const info = createDefault()
230
- .with(PACKAGE_SEGMENT)
231
- .with({key: 'sdk-js-auth', value: AUTH_VERSION})
232
- .with({key: 'auth', value: options.credentials?.name() ?? 'default'});
233
- this.userAgent = info.toString();
234
- this.httpClient = newHttpClient(options);
235
- }
236
-
237
- /** Batch get a published listing in the Databricks Marketplace that the consumer has access to. */
238
- async batchGetListings(
239
- req: BatchGetListingsRequest,
240
- options?: CallOptions
241
- ): Promise<BatchGetListingsResponse> {
242
- const url = `${this.host}/api/2.1/marketplace-consumer/listings:batchGet`;
243
- const params = new URLSearchParams();
244
- if (req.ids !== undefined) {
245
- params.append('ids', String(req.ids));
246
- }
247
- const query = params.toString();
248
- const fullUrl = query !== '' ? `${url}?${query}` : url;
249
- let resp: BatchGetListingsResponse | undefined;
250
- const call = async (callSignal?: AbortSignal): Promise<void> => {
251
- const headers = new Headers();
252
- if (this.workspaceId !== undefined) {
253
- headers.set('X-Databricks-Org-Id', this.workspaceId);
254
- }
255
- headers.set('User-Agent', this.userAgent);
256
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
257
- const respBody = await executeHttpCall({
258
- request: httpReq,
259
- httpClient: this.httpClient,
260
- logger: this.logger,
261
- });
262
- resp = parseResponse(respBody, unmarshalBatchGetListingsResponseSchema);
263
- };
264
- await executeCall(call, options);
265
- if (resp === undefined) {
266
- throw new Error('operation completed without a result.');
267
- }
268
- return resp;
269
- }
270
-
271
- /** Batch get a provider in the Databricks Marketplace with at least one visible listing. */
272
- async batchGetProviders(
273
- req: BatchGetProvidersRequest,
274
- options?: CallOptions
275
- ): Promise<BatchGetProvidersResponse> {
276
- const url = `${this.host}/api/2.1/marketplace-consumer/providers:batchGet`;
277
- const params = new URLSearchParams();
278
- if (req.ids !== undefined) {
279
- params.append('ids', String(req.ids));
280
- }
281
- const query = params.toString();
282
- const fullUrl = query !== '' ? `${url}?${query}` : url;
283
- let resp: BatchGetProvidersResponse | undefined;
284
- const call = async (callSignal?: AbortSignal): Promise<void> => {
285
- const headers = new Headers();
286
- if (this.workspaceId !== undefined) {
287
- headers.set('X-Databricks-Org-Id', this.workspaceId);
288
- }
289
- headers.set('User-Agent', this.userAgent);
290
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
291
- const respBody = await executeHttpCall({
292
- request: httpReq,
293
- httpClient: this.httpClient,
294
- logger: this.logger,
295
- });
296
- resp = parseResponse(respBody, unmarshalBatchGetProvidersResponseSchema);
297
- };
298
- await executeCall(call, options);
299
- if (resp === undefined) {
300
- throw new Error('operation completed without a result.');
301
- }
302
- return resp;
303
- }
304
-
305
- /** Create a personalization request for a listing. */
306
- async createPersonalizationRequest(
307
- req: CreatePersonalizationRequest,
308
- options?: CallOptions
309
- ): Promise<CreatePersonalizationRequest_Response> {
310
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/personalization-requests`;
311
- const body = marshalRequest(req, marshalCreatePersonalizationRequestSchema);
312
- let resp: CreatePersonalizationRequest_Response | undefined;
313
- const call = async (callSignal?: AbortSignal): Promise<void> => {
314
- const headers = new Headers({'Content-Type': 'application/json'});
315
- if (this.workspaceId !== undefined) {
316
- headers.set('X-Databricks-Org-Id', this.workspaceId);
317
- }
318
- headers.set('User-Agent', this.userAgent);
319
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
320
- const respBody = await executeHttpCall({
321
- request: httpReq,
322
- httpClient: this.httpClient,
323
- logger: this.logger,
324
- });
325
- resp = parseResponse(
326
- respBody,
327
- unmarshalCreatePersonalizationRequest_ResponseSchema
328
- );
329
- };
330
- await executeCall(call, options);
331
- if (resp === undefined) {
332
- throw new Error('operation completed without a result.');
333
- }
334
- return resp;
335
- }
336
-
337
- /** List all installations for a particular listing. */
338
- async getInstallationDetails(
339
- req: GetInstallationDetails,
340
- options?: CallOptions
341
- ): Promise<GetInstallationDetails_Response> {
342
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
343
- const params = new URLSearchParams();
344
- if (req.pageToken !== undefined) {
345
- params.append('page_token', req.pageToken);
346
- }
347
- if (req.pageSize !== undefined) {
348
- params.append('page_size', String(req.pageSize));
349
- }
350
- const query = params.toString();
351
- const fullUrl = query !== '' ? `${url}?${query}` : url;
352
- let resp: GetInstallationDetails_Response | undefined;
353
- const call = async (callSignal?: AbortSignal): Promise<void> => {
354
- const headers = new Headers();
355
- if (this.workspaceId !== undefined) {
356
- headers.set('X-Databricks-Org-Id', this.workspaceId);
357
- }
358
- headers.set('User-Agent', this.userAgent);
359
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
360
- const respBody = await executeHttpCall({
361
- request: httpReq,
362
- httpClient: this.httpClient,
363
- logger: this.logger,
364
- });
365
- resp = parseResponse(
366
- respBody,
367
- unmarshalGetInstallationDetails_ResponseSchema
368
- );
369
- };
370
- await executeCall(call, options);
371
- if (resp === undefined) {
372
- throw new Error('operation completed without a result.');
373
- }
374
- return resp;
375
- }
376
-
377
- async *getInstallationDetailsIter(
378
- req: GetInstallationDetails,
379
- options?: CallOptions
380
- ): AsyncGenerator<InstallationDetail> {
381
- const pageReq: GetInstallationDetails = {...req};
382
- for (;;) {
383
- const resp = await this.getInstallationDetails(pageReq, options);
384
- for (const item of resp.installations ?? []) {
385
- yield item;
386
- }
387
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
388
- return;
389
- }
390
- pageReq.pageToken = resp.nextPageToken;
391
- }
392
- }
393
-
394
- /** Get a high level preview of the metadata of listing installable content. */
395
- async getListingContent(
396
- req: GetListingContent,
397
- options?: CallOptions
398
- ): Promise<GetListingContent_Response> {
399
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/content`;
400
- const params = new URLSearchParams();
401
- if (req.pageToken !== undefined) {
402
- params.append('page_token', req.pageToken);
403
- }
404
- if (req.pageSize !== undefined) {
405
- params.append('page_size', String(req.pageSize));
406
- }
407
- const query = params.toString();
408
- const fullUrl = query !== '' ? `${url}?${query}` : url;
409
- let resp: GetListingContent_Response | undefined;
410
- const call = async (callSignal?: AbortSignal): Promise<void> => {
411
- const headers = new Headers();
412
- if (this.workspaceId !== undefined) {
413
- headers.set('X-Databricks-Org-Id', this.workspaceId);
414
- }
415
- headers.set('User-Agent', this.userAgent);
416
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
417
- const respBody = await executeHttpCall({
418
- request: httpReq,
419
- httpClient: this.httpClient,
420
- logger: this.logger,
421
- });
422
- resp = parseResponse(respBody, unmarshalGetListingContent_ResponseSchema);
423
- };
424
- await executeCall(call, options);
425
- if (resp === undefined) {
426
- throw new Error('operation completed without a result.');
427
- }
428
- return resp;
429
- }
430
-
431
- async *getListingContentIter(
432
- req: GetListingContent,
433
- options?: CallOptions
434
- ): AsyncGenerator<SharedDataObject> {
435
- const pageReq: GetListingContent = {...req};
436
- for (;;) {
437
- const resp = await this.getListingContent(pageReq, options);
438
- for (const item of resp.sharedDataObjects ?? []) {
439
- yield item;
440
- }
441
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
442
- return;
443
- }
444
- pageReq.pageToken = resp.nextPageToken;
445
- }
446
- }
447
-
448
- /** Get the personalization request for a listing. Each consumer can make at *most* one personalization request for a listing. */
449
- async getPersonalizationRequestsForConsumer(
450
- req: GetPersonalizationRequestsForConsumer,
451
- options?: CallOptions
452
- ): Promise<GetPersonalizationRequestsForConsumer_Response> {
453
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/personalization-requests`;
454
- let resp: GetPersonalizationRequestsForConsumer_Response | undefined;
455
- const call = async (callSignal?: AbortSignal): Promise<void> => {
456
- const headers = new Headers();
457
- if (this.workspaceId !== undefined) {
458
- headers.set('X-Databricks-Org-Id', this.workspaceId);
459
- }
460
- headers.set('User-Agent', this.userAgent);
461
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
462
- const respBody = await executeHttpCall({
463
- request: httpReq,
464
- httpClient: this.httpClient,
465
- logger: this.logger,
466
- });
467
- resp = parseResponse(
468
- respBody,
469
- unmarshalGetPersonalizationRequestsForConsumer_ResponseSchema
470
- );
471
- };
472
- await executeCall(call, options);
473
- if (resp === undefined) {
474
- throw new Error('operation completed without a result.');
475
- }
476
- return resp;
477
- }
478
-
479
- /** Get a published listing in the Databricks Marketplace that the consumer has access to. */
480
- async getPublishedListingForConsumer(
481
- req: GetPublishedListingForConsumer,
482
- options?: CallOptions
483
- ): Promise<GetPublishedListingForConsumer_Response> {
484
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.id ?? ''}`;
485
- let resp: GetPublishedListingForConsumer_Response | undefined;
486
- const call = async (callSignal?: AbortSignal): Promise<void> => {
487
- const headers = new Headers();
488
- if (this.workspaceId !== undefined) {
489
- headers.set('X-Databricks-Org-Id', this.workspaceId);
490
- }
491
- headers.set('User-Agent', this.userAgent);
492
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
493
- const respBody = await executeHttpCall({
494
- request: httpReq,
495
- httpClient: this.httpClient,
496
- logger: this.logger,
497
- });
498
- resp = parseResponse(
499
- respBody,
500
- unmarshalGetPublishedListingForConsumer_ResponseSchema
501
- );
502
- };
503
- await executeCall(call, options);
504
- if (resp === undefined) {
505
- throw new Error('operation completed without a result.');
506
- }
507
- return resp;
508
- }
509
-
510
- /** Get a provider in the Databricks Marketplace with at least one visible listing. */
511
- async getPublishedProviderForConsumer(
512
- req: GetPublishedProviderForConsumer,
513
- options?: CallOptions
514
- ): Promise<GetPublishedProviderForConsumer_Response> {
515
- const url = `${this.host}/api/2.0/marketplace-consumer/providers/${req.id ?? ''}`;
516
- let resp: GetPublishedProviderForConsumer_Response | undefined;
517
- const call = async (callSignal?: AbortSignal): Promise<void> => {
518
- const headers = new Headers();
519
- if (this.workspaceId !== undefined) {
520
- headers.set('X-Databricks-Org-Id', this.workspaceId);
521
- }
522
- headers.set('User-Agent', this.userAgent);
523
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
524
- const respBody = await executeHttpCall({
525
- request: httpReq,
526
- httpClient: this.httpClient,
527
- logger: this.logger,
528
- });
529
- resp = parseResponse(
530
- respBody,
531
- unmarshalGetPublishedProviderForConsumer_ResponseSchema
532
- );
533
- };
534
- await executeCall(call, options);
535
- if (resp === undefined) {
536
- throw new Error('operation completed without a result.');
537
- }
538
- return resp;
539
- }
540
-
541
- /** Install payload associated with a Databricks Marketplace listing. */
542
- async installListing(
543
- req: InstallListing,
544
- options?: CallOptions
545
- ): Promise<InstallListing_Response> {
546
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations`;
547
- const body = marshalRequest(req, marshalInstallListingSchema);
548
- let resp: InstallListing_Response | undefined;
549
- const call = async (callSignal?: AbortSignal): Promise<void> => {
550
- const headers = new Headers({'Content-Type': 'application/json'});
551
- if (this.workspaceId !== undefined) {
552
- headers.set('X-Databricks-Org-Id', this.workspaceId);
553
- }
554
- headers.set('User-Agent', this.userAgent);
555
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
556
- const respBody = await executeHttpCall({
557
- request: httpReq,
558
- httpClient: this.httpClient,
559
- logger: this.logger,
560
- });
561
- resp = parseResponse(respBody, unmarshalInstallListing_ResponseSchema);
562
- };
563
- await executeCall(call, options);
564
- if (resp === undefined) {
565
- throw new Error('operation completed without a result.');
566
- }
567
- return resp;
568
- }
569
-
570
- /** List all installations across all listings. */
571
- async listInstallations(
572
- req: ListInstallationsRequest,
573
- options?: CallOptions
574
- ): Promise<ListInstallationsRequest_Response> {
575
- const url = `${this.host}/api/2.0/marketplace-consumer/installations`;
576
- const params = new URLSearchParams();
577
- if (req.pageToken !== undefined) {
578
- params.append('page_token', req.pageToken);
579
- }
580
- if (req.pageSize !== undefined) {
581
- params.append('page_size', String(req.pageSize));
582
- }
583
- const query = params.toString();
584
- const fullUrl = query !== '' ? `${url}?${query}` : url;
585
- let resp: ListInstallationsRequest_Response | undefined;
586
- const call = async (callSignal?: AbortSignal): Promise<void> => {
587
- const headers = new Headers();
588
- if (this.workspaceId !== undefined) {
589
- headers.set('X-Databricks-Org-Id', this.workspaceId);
590
- }
591
- headers.set('User-Agent', this.userAgent);
592
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
593
- const respBody = await executeHttpCall({
594
- request: httpReq,
595
- httpClient: this.httpClient,
596
- logger: this.logger,
597
- });
598
- resp = parseResponse(
599
- respBody,
600
- unmarshalListInstallationsRequest_ResponseSchema
601
- );
602
- };
603
- await executeCall(call, options);
604
- if (resp === undefined) {
605
- throw new Error('operation completed without a result.');
606
- }
607
- return resp;
608
- }
609
-
610
- async *listInstallationsIter(
611
- req: ListInstallationsRequest,
612
- options?: CallOptions
613
- ): AsyncGenerator<InstallationDetail> {
614
- const pageReq: ListInstallationsRequest = {...req};
615
- for (;;) {
616
- const resp = await this.listInstallations(pageReq, options);
617
- for (const item of resp.installations ?? []) {
618
- yield item;
619
- }
620
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
621
- return;
622
- }
623
- pageReq.pageToken = resp.nextPageToken;
624
- }
625
- }
626
-
627
- /**
628
- * Get all listings fulfillments associated with a listing. A _fulfillment_ is a potential installation.
629
- * Standard installations contain metadata about the attached share or git repo. Only one of these fields will be present.
630
- * Personalized installations contain metadata about the attached share or git repo, as well as the Delta Sharing recipient type.
631
- */
632
- async listListingFulfillments(
633
- req: ListListingFulfillmentsRequest,
634
- options?: CallOptions
635
- ): Promise<ListListingFulfillmentsRequest_Response> {
636
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/fulfillments`;
637
- const params = new URLSearchParams();
638
- if (req.pageToken !== undefined) {
639
- params.append('page_token', req.pageToken);
640
- }
641
- if (req.pageSize !== undefined) {
642
- params.append('page_size', String(req.pageSize));
643
- }
644
- const query = params.toString();
645
- const fullUrl = query !== '' ? `${url}?${query}` : url;
646
- let resp: ListListingFulfillmentsRequest_Response | undefined;
647
- const call = async (callSignal?: AbortSignal): Promise<void> => {
648
- const headers = new Headers();
649
- if (this.workspaceId !== undefined) {
650
- headers.set('X-Databricks-Org-Id', this.workspaceId);
651
- }
652
- headers.set('User-Agent', this.userAgent);
653
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
654
- const respBody = await executeHttpCall({
655
- request: httpReq,
656
- httpClient: this.httpClient,
657
- logger: this.logger,
658
- });
659
- resp = parseResponse(
660
- respBody,
661
- unmarshalListListingFulfillmentsRequest_ResponseSchema
662
- );
663
- };
664
- await executeCall(call, options);
665
- if (resp === undefined) {
666
- throw new Error('operation completed without a result.');
667
- }
668
- return resp;
669
- }
670
-
671
- async *listListingFulfillmentsIter(
672
- req: ListListingFulfillmentsRequest,
673
- options?: CallOptions
674
- ): AsyncGenerator<ListingFulfillment> {
675
- const pageReq: ListListingFulfillmentsRequest = {...req};
676
- for (;;) {
677
- const resp = await this.listListingFulfillments(pageReq, options);
678
- for (const item of resp.fulfillments ?? []) {
679
- yield item;
680
- }
681
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
682
- return;
683
- }
684
- pageReq.pageToken = resp.nextPageToken;
685
- }
686
- }
687
-
688
- /** List personalization requests for a consumer across all listings. */
689
- async listPersonalizationRequestsForConsumer(
690
- req: ListPersonalizationRequestsForConsumerRequest,
691
- options?: CallOptions
692
- ): Promise<ListPersonalizationRequestsForConsumerRequest_Response> {
693
- const url = `${this.host}/api/2.0/marketplace-consumer/personalization-requests`;
694
- const params = new URLSearchParams();
695
- if (req.pageToken !== undefined) {
696
- params.append('page_token', req.pageToken);
697
- }
698
- if (req.pageSize !== undefined) {
699
- params.append('page_size', String(req.pageSize));
700
- }
701
- const query = params.toString();
702
- const fullUrl = query !== '' ? `${url}?${query}` : url;
703
- let resp:
704
- | ListPersonalizationRequestsForConsumerRequest_Response
705
- | undefined;
706
- const call = async (callSignal?: AbortSignal): Promise<void> => {
707
- const headers = new Headers();
708
- if (this.workspaceId !== undefined) {
709
- headers.set('X-Databricks-Org-Id', this.workspaceId);
710
- }
711
- headers.set('User-Agent', this.userAgent);
712
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
713
- const respBody = await executeHttpCall({
714
- request: httpReq,
715
- httpClient: this.httpClient,
716
- logger: this.logger,
717
- });
718
- resp = parseResponse(
719
- respBody,
720
- unmarshalListPersonalizationRequestsForConsumerRequest_ResponseSchema
721
- );
722
- };
723
- await executeCall(call, options);
724
- if (resp === undefined) {
725
- throw new Error('operation completed without a result.');
726
- }
727
- return resp;
728
- }
729
-
730
- async *listPersonalizationRequestsForConsumerIter(
731
- req: ListPersonalizationRequestsForConsumerRequest,
732
- options?: CallOptions
733
- ): AsyncGenerator<PersonalizationRequest> {
734
- const pageReq: ListPersonalizationRequestsForConsumerRequest = {...req};
735
- for (;;) {
736
- const resp = await this.listPersonalizationRequestsForConsumer(
737
- pageReq,
738
- options
739
- );
740
- for (const item of resp.personalizationRequests ?? []) {
741
- yield item;
742
- }
743
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
744
- return;
745
- }
746
- pageReq.pageToken = resp.nextPageToken;
747
- }
748
- }
749
-
750
- /** List all published listings in the Databricks Marketplace that the consumer has access to. */
751
- async listPublishedListingsForConsumer(
752
- req: ListPublishedListingsForConsumerRequest,
753
- options?: CallOptions
754
- ): Promise<ListPublishedListingsForConsumerRequest_Response> {
755
- const url = `${this.host}/api/2.0/marketplace-consumer/listings`;
756
- const params = new URLSearchParams();
757
- if (req.pageToken !== undefined) {
758
- params.append('page_token', req.pageToken);
759
- }
760
- if (req.pageSize !== undefined) {
761
- params.append('page_size', String(req.pageSize));
762
- }
763
- if (req.assets !== undefined) {
764
- params.append('assets', String(req.assets));
765
- }
766
- if (req.categories !== undefined) {
767
- params.append('categories', String(req.categories));
768
- }
769
- if (req.tags !== undefined) {
770
- flattenQueryParams(
771
- 'tags',
772
- marshalListingTagSchema.parse(req.tags),
773
- params
774
- );
775
- }
776
- if (req.isFree !== undefined) {
777
- params.append('is_free', String(req.isFree));
778
- }
779
- if (req.isPrivateExchange !== undefined) {
780
- params.append('is_private_exchange', String(req.isPrivateExchange));
781
- }
782
- if (req.isStaffPick !== undefined) {
783
- params.append('is_staff_pick', String(req.isStaffPick));
784
- }
785
- if (req.providerIds !== undefined) {
786
- params.append('provider_ids', String(req.providerIds));
787
- }
788
- const query = params.toString();
789
- const fullUrl = query !== '' ? `${url}?${query}` : url;
790
- let resp: ListPublishedListingsForConsumerRequest_Response | undefined;
791
- const call = async (callSignal?: AbortSignal): Promise<void> => {
792
- const headers = new Headers();
793
- if (this.workspaceId !== undefined) {
794
- headers.set('X-Databricks-Org-Id', this.workspaceId);
795
- }
796
- headers.set('User-Agent', this.userAgent);
797
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
798
- const respBody = await executeHttpCall({
799
- request: httpReq,
800
- httpClient: this.httpClient,
801
- logger: this.logger,
802
- });
803
- resp = parseResponse(
804
- respBody,
805
- unmarshalListPublishedListingsForConsumerRequest_ResponseSchema
806
- );
807
- };
808
- await executeCall(call, options);
809
- if (resp === undefined) {
810
- throw new Error('operation completed without a result.');
811
- }
812
- return resp;
813
- }
814
-
815
- async *listPublishedListingsForConsumerIter(
816
- req: ListPublishedListingsForConsumerRequest,
817
- options?: CallOptions
818
- ): AsyncGenerator<Listing> {
819
- const pageReq: ListPublishedListingsForConsumerRequest = {...req};
820
- for (;;) {
821
- const resp = await this.listPublishedListingsForConsumer(
822
- pageReq,
823
- options
824
- );
825
- for (const item of resp.listings ?? []) {
826
- yield item;
827
- }
828
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
829
- return;
830
- }
831
- pageReq.pageToken = resp.nextPageToken;
832
- }
833
- }
834
-
835
- /** List all providers in the Databricks Marketplace with at least one visible listing. */
836
- async listPublishedProvidersForConsumer(
837
- req: ListPublishedProvidersForConsumer,
838
- options?: CallOptions
839
- ): Promise<ListPublishedProvidersForConsumer_Response> {
840
- const url = `${this.host}/api/2.0/marketplace-consumer/providers`;
841
- const params = new URLSearchParams();
842
- if (req.pageToken !== undefined) {
843
- params.append('page_token', req.pageToken);
844
- }
845
- if (req.pageSize !== undefined) {
846
- params.append('page_size', String(req.pageSize));
847
- }
848
- if (req.isFeatured !== undefined) {
849
- params.append('is_featured', String(req.isFeatured));
850
- }
851
- const query = params.toString();
852
- const fullUrl = query !== '' ? `${url}?${query}` : url;
853
- let resp: ListPublishedProvidersForConsumer_Response | undefined;
854
- const call = async (callSignal?: AbortSignal): Promise<void> => {
855
- const headers = new Headers();
856
- if (this.workspaceId !== undefined) {
857
- headers.set('X-Databricks-Org-Id', this.workspaceId);
858
- }
859
- headers.set('User-Agent', this.userAgent);
860
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
861
- const respBody = await executeHttpCall({
862
- request: httpReq,
863
- httpClient: this.httpClient,
864
- logger: this.logger,
865
- });
866
- resp = parseResponse(
867
- respBody,
868
- unmarshalListPublishedProvidersForConsumer_ResponseSchema
869
- );
870
- };
871
- await executeCall(call, options);
872
- if (resp === undefined) {
873
- throw new Error('operation completed without a result.');
874
- }
875
- return resp;
876
- }
877
-
878
- async *listPublishedProvidersForConsumerIter(
879
- req: ListPublishedProvidersForConsumer,
880
- options?: CallOptions
881
- ): AsyncGenerator<ProviderInfo> {
882
- const pageReq: ListPublishedProvidersForConsumer = {...req};
883
- for (;;) {
884
- const resp = await this.listPublishedProvidersForConsumer(
885
- pageReq,
886
- options
887
- );
888
- for (const item of resp.providers ?? []) {
889
- yield item;
890
- }
891
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
892
- return;
893
- }
894
- pageReq.pageToken = resp.nextPageToken;
895
- }
896
- }
897
-
898
- /**
899
- * Search published listings in the Databricks Marketplace that the consumer has access to.
900
- * This query supports a variety of different search parameters and performs fuzzy matching.
901
- */
902
- async searchPublishedListingsForConsumer(
903
- req: SearchPublishedListingsForConsumer,
904
- options?: CallOptions
905
- ): Promise<SearchPublishedListingsForConsumer_Response> {
906
- const url = `${this.host}/api/2.0/marketplace-consumer/search-listings`;
907
- const params = new URLSearchParams();
908
- if (req.query !== undefined) {
909
- params.append('query', req.query);
910
- }
911
- if (req.isFree !== undefined) {
912
- params.append('is_free', String(req.isFree));
913
- }
914
- if (req.isPrivateExchange !== undefined) {
915
- params.append('is_private_exchange', String(req.isPrivateExchange));
916
- }
917
- if (req.providerIds !== undefined) {
918
- params.append('provider_ids', String(req.providerIds));
919
- }
920
- if (req.categories !== undefined) {
921
- params.append('categories', String(req.categories));
922
- }
923
- if (req.assets !== undefined) {
924
- params.append('assets', String(req.assets));
925
- }
926
- if (req.pageToken !== undefined) {
927
- params.append('page_token', req.pageToken);
928
- }
929
- if (req.pageSize !== undefined) {
930
- params.append('page_size', String(req.pageSize));
931
- }
932
- const query = params.toString();
933
- const fullUrl = query !== '' ? `${url}?${query}` : url;
934
- let resp: SearchPublishedListingsForConsumer_Response | undefined;
935
- const call = async (callSignal?: AbortSignal): Promise<void> => {
936
- const headers = new Headers();
937
- if (this.workspaceId !== undefined) {
938
- headers.set('X-Databricks-Org-Id', this.workspaceId);
939
- }
940
- headers.set('User-Agent', this.userAgent);
941
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
942
- const respBody = await executeHttpCall({
943
- request: httpReq,
944
- httpClient: this.httpClient,
945
- logger: this.logger,
946
- });
947
- resp = parseResponse(
948
- respBody,
949
- unmarshalSearchPublishedListingsForConsumer_ResponseSchema
950
- );
951
- };
952
- await executeCall(call, options);
953
- if (resp === undefined) {
954
- throw new Error('operation completed without a result.');
955
- }
956
- return resp;
957
- }
958
-
959
- async *searchPublishedListingsForConsumerIter(
960
- req: SearchPublishedListingsForConsumer,
961
- options?: CallOptions
962
- ): AsyncGenerator<Listing> {
963
- const pageReq: SearchPublishedListingsForConsumer = {...req};
964
- for (;;) {
965
- const resp = await this.searchPublishedListingsForConsumer(
966
- pageReq,
967
- options
968
- );
969
- for (const item of resp.listings ?? []) {
970
- yield item;
971
- }
972
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
973
- return;
974
- }
975
- pageReq.pageToken = resp.nextPageToken;
976
- }
977
- }
978
-
979
- /** Uninstall an installation associated with a Databricks Marketplace listing. */
980
- async uninstallListing(
981
- req: UninstallListing,
982
- options?: CallOptions
983
- ): Promise<UninstallListing_Response> {
984
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations/${req.installationId ?? ''}`;
985
- let resp: UninstallListing_Response | undefined;
986
- const call = async (callSignal?: AbortSignal): Promise<void> => {
987
- const headers = new Headers();
988
- if (this.workspaceId !== undefined) {
989
- headers.set('X-Databricks-Org-Id', this.workspaceId);
990
- }
991
- headers.set('User-Agent', this.userAgent);
992
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
993
- const respBody = await executeHttpCall({
994
- request: httpReq,
995
- httpClient: this.httpClient,
996
- logger: this.logger,
997
- });
998
- resp = parseResponse(respBody, unmarshalUninstallListing_ResponseSchema);
999
- };
1000
- await executeCall(call, options);
1001
- if (resp === undefined) {
1002
- throw new Error('operation completed without a result.');
1003
- }
1004
- return resp;
1005
- }
1006
-
1007
- /**
1008
- * This is a update API that will update the part of the fields defined in the installation table as well
1009
- * as interact with external services according to the fields not included in the installation table
1010
- * 1. the token will be rotate if the rotateToken flag is true
1011
- * 2. the token will be forcibly rotate if the rotateToken flag is true and the tokenInfo field is empty
1012
- */
1013
- async updateInstallationDetail(
1014
- req: UpdateInstallationDetail,
1015
- options?: CallOptions
1016
- ): Promise<UpdateInstallationDetail_Response> {
1017
- const url = `${this.host}/api/2.0/marketplace-consumer/listings/${req.listingId ?? ''}/installations/${req.installationId ?? ''}`;
1018
- const body = marshalRequest(req, marshalUpdateInstallationDetailSchema);
1019
- let resp: UpdateInstallationDetail_Response | undefined;
1020
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1021
- const headers = new Headers({'Content-Type': 'application/json'});
1022
- if (this.workspaceId !== undefined) {
1023
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1024
- }
1025
- headers.set('User-Agent', this.userAgent);
1026
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
1027
- const respBody = await executeHttpCall({
1028
- request: httpReq,
1029
- httpClient: this.httpClient,
1030
- logger: this.logger,
1031
- });
1032
- resp = parseResponse(
1033
- respBody,
1034
- unmarshalUpdateInstallationDetail_ResponseSchema
1035
- );
1036
- };
1037
- await executeCall(call, options);
1038
- if (resp === undefined) {
1039
- throw new Error('operation completed without a result.');
1040
- }
1041
- return resp;
1042
- }
1043
-
1044
- /** Associate an exchange with a listing */
1045
- async addExchangeForListing(
1046
- req: AddExchangeForListingRequest,
1047
- options?: CallOptions
1048
- ): Promise<AddExchangeForListingResponse> {
1049
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges-for-listing`;
1050
- const body = marshalRequest(req, marshalAddExchangeForListingRequestSchema);
1051
- let resp: AddExchangeForListingResponse | undefined;
1052
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1053
- const headers = new Headers({'Content-Type': 'application/json'});
1054
- if (this.workspaceId !== undefined) {
1055
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1056
- }
1057
- headers.set('User-Agent', this.userAgent);
1058
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1059
- const respBody = await executeHttpCall({
1060
- request: httpReq,
1061
- httpClient: this.httpClient,
1062
- logger: this.logger,
1063
- });
1064
- resp = parseResponse(
1065
- respBody,
1066
- unmarshalAddExchangeForListingResponseSchema
1067
- );
1068
- };
1069
- await executeCall(call, options);
1070
- if (resp === undefined) {
1071
- throw new Error('operation completed without a result.');
1072
- }
1073
- return resp;
1074
- }
1075
-
1076
- /** Create an exchange */
1077
- async createExchange(
1078
- req: CreateExchangeRequest,
1079
- options?: CallOptions
1080
- ): Promise<CreateExchangeResponse> {
1081
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges`;
1082
- const body = marshalRequest(req, marshalCreateExchangeRequestSchema);
1083
- let resp: CreateExchangeResponse | undefined;
1084
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1085
- const headers = new Headers({'Content-Type': 'application/json'});
1086
- if (this.workspaceId !== undefined) {
1087
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1088
- }
1089
- headers.set('User-Agent', this.userAgent);
1090
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1091
- const respBody = await executeHttpCall({
1092
- request: httpReq,
1093
- httpClient: this.httpClient,
1094
- logger: this.logger,
1095
- });
1096
- resp = parseResponse(respBody, unmarshalCreateExchangeResponseSchema);
1097
- };
1098
- await executeCall(call, options);
1099
- if (resp === undefined) {
1100
- throw new Error('operation completed without a result.');
1101
- }
1102
- return resp;
1103
- }
1104
-
1105
- /** Add an exchange filter. */
1106
- async createExchangeFilter(
1107
- req: CreateExchangeFilterRequest,
1108
- options?: CallOptions
1109
- ): Promise<CreateExchangeFilterResponse> {
1110
- const url = `${this.host}/api/2.0/marketplace-exchange/filters`;
1111
- const body = marshalRequest(req, marshalCreateExchangeFilterRequestSchema);
1112
- let resp: CreateExchangeFilterResponse | undefined;
1113
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1114
- const headers = new Headers({'Content-Type': 'application/json'});
1115
- if (this.workspaceId !== undefined) {
1116
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1117
- }
1118
- headers.set('User-Agent', this.userAgent);
1119
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1120
- const respBody = await executeHttpCall({
1121
- request: httpReq,
1122
- httpClient: this.httpClient,
1123
- logger: this.logger,
1124
- });
1125
- resp = parseResponse(
1126
- respBody,
1127
- unmarshalCreateExchangeFilterResponseSchema
1128
- );
1129
- };
1130
- await executeCall(call, options);
1131
- if (resp === undefined) {
1132
- throw new Error('operation completed without a result.');
1133
- }
1134
- return resp;
1135
- }
1136
-
1137
- /** Create a file. Currently, only provider icons and attached notebooks are supported. */
1138
- async createFile(
1139
- req: CreateFileRequest,
1140
- options?: CallOptions
1141
- ): Promise<CreateFileRequest_Response> {
1142
- const url = `${this.host}/api/2.0/marketplace-provider/files`;
1143
- const body = marshalRequest(req, marshalCreateFileRequestSchema);
1144
- let resp: CreateFileRequest_Response | undefined;
1145
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1146
- const headers = new Headers({'Content-Type': 'application/json'});
1147
- if (this.workspaceId !== undefined) {
1148
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1149
- }
1150
- headers.set('User-Agent', this.userAgent);
1151
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1152
- const respBody = await executeHttpCall({
1153
- request: httpReq,
1154
- httpClient: this.httpClient,
1155
- logger: this.logger,
1156
- });
1157
- resp = parseResponse(respBody, unmarshalCreateFileRequest_ResponseSchema);
1158
- };
1159
- await executeCall(call, options);
1160
- if (resp === undefined) {
1161
- throw new Error('operation completed without a result.');
1162
- }
1163
- return resp;
1164
- }
1165
-
1166
- /** Create a new listing */
1167
- async createListing(
1168
- req: CreateListingRequest,
1169
- options?: CallOptions
1170
- ): Promise<CreateListingRequest_Response> {
1171
- const url = `${this.host}/api/2.0/marketplace-provider/listing`;
1172
- const body = marshalRequest(req, marshalCreateListingRequestSchema);
1173
- let resp: CreateListingRequest_Response | undefined;
1174
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1175
- const headers = new Headers({'Content-Type': 'application/json'});
1176
- if (this.workspaceId !== undefined) {
1177
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1178
- }
1179
- headers.set('User-Agent', this.userAgent);
1180
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1181
- const respBody = await executeHttpCall({
1182
- request: httpReq,
1183
- httpClient: this.httpClient,
1184
- logger: this.logger,
1185
- });
1186
- resp = parseResponse(
1187
- respBody,
1188
- unmarshalCreateListingRequest_ResponseSchema
1189
- );
1190
- };
1191
- await executeCall(call, options);
1192
- if (resp === undefined) {
1193
- throw new Error('operation completed without a result.');
1194
- }
1195
- return resp;
1196
- }
1197
-
1198
- /** Create a provider */
1199
- async createProvider(
1200
- req: CreateProviderRequest,
1201
- options?: CallOptions
1202
- ): Promise<CreateProviderRequest_Response> {
1203
- const url = `${this.host}/api/2.0/marketplace-provider/provider`;
1204
- const body = marshalRequest(req, marshalCreateProviderRequestSchema);
1205
- let resp: CreateProviderRequest_Response | undefined;
1206
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1207
- const headers = new Headers({'Content-Type': 'application/json'});
1208
- if (this.workspaceId !== undefined) {
1209
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1210
- }
1211
- headers.set('User-Agent', this.userAgent);
1212
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1213
- const respBody = await executeHttpCall({
1214
- request: httpReq,
1215
- httpClient: this.httpClient,
1216
- logger: this.logger,
1217
- });
1218
- resp = parseResponse(
1219
- respBody,
1220
- unmarshalCreateProviderRequest_ResponseSchema
1221
- );
1222
- };
1223
- await executeCall(call, options);
1224
- if (resp === undefined) {
1225
- throw new Error('operation completed without a result.');
1226
- }
1227
- return resp;
1228
- }
1229
-
1230
- /** Create provider analytics dashboard. Returns Marketplace specific `id`. Not to be confused with the Lakeview dashboard id. */
1231
- async createProviderAnalyticsDashboard(
1232
- req: CreateProviderAnalyticsDashboardRequest,
1233
- options?: CallOptions
1234
- ): Promise<CreateProviderAnalyticsDashboardRequest_Response> {
1235
- const url = `${this.host}/api/2.0/marketplace-provider/analytics_dashboard`;
1236
- const body = marshalRequest(
1237
- req,
1238
- marshalCreateProviderAnalyticsDashboardRequestSchema
1239
- );
1240
- let resp: CreateProviderAnalyticsDashboardRequest_Response | undefined;
1241
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1242
- const headers = new Headers({'Content-Type': 'application/json'});
1243
- if (this.workspaceId !== undefined) {
1244
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1245
- }
1246
- headers.set('User-Agent', this.userAgent);
1247
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1248
- const respBody = await executeHttpCall({
1249
- request: httpReq,
1250
- httpClient: this.httpClient,
1251
- logger: this.logger,
1252
- });
1253
- resp = parseResponse(
1254
- respBody,
1255
- unmarshalCreateProviderAnalyticsDashboardRequest_ResponseSchema
1256
- );
1257
- };
1258
- await executeCall(call, options);
1259
- if (resp === undefined) {
1260
- throw new Error('operation completed without a result.');
1261
- }
1262
- return resp;
1263
- }
1264
-
1265
- /** This removes a listing from marketplace. */
1266
- async deleteExchange(
1267
- req: DeleteExchangeRequest,
1268
- options?: CallOptions
1269
- ): Promise<DeleteExchangeResponse> {
1270
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges/${req.id ?? ''}`;
1271
- let resp: DeleteExchangeResponse | undefined;
1272
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1273
- const headers = new Headers();
1274
- if (this.workspaceId !== undefined) {
1275
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1276
- }
1277
- headers.set('User-Agent', this.userAgent);
1278
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
1279
- const respBody = await executeHttpCall({
1280
- request: httpReq,
1281
- httpClient: this.httpClient,
1282
- logger: this.logger,
1283
- });
1284
- resp = parseResponse(respBody, unmarshalDeleteExchangeResponseSchema);
1285
- };
1286
- await executeCall(call, options);
1287
- if (resp === undefined) {
1288
- throw new Error('operation completed without a result.');
1289
- }
1290
- return resp;
1291
- }
1292
-
1293
- /** Delete an exchange filter */
1294
- async deleteExchangeFilter(
1295
- req: DeleteExchangeFilterRequest,
1296
- options?: CallOptions
1297
- ): Promise<DeleteExchangeFilterResponse> {
1298
- const url = `${this.host}/api/2.0/marketplace-exchange/filters/${req.id ?? ''}`;
1299
- let resp: DeleteExchangeFilterResponse | undefined;
1300
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1301
- const headers = new Headers();
1302
- if (this.workspaceId !== undefined) {
1303
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1304
- }
1305
- headers.set('User-Agent', this.userAgent);
1306
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
1307
- const respBody = await executeHttpCall({
1308
- request: httpReq,
1309
- httpClient: this.httpClient,
1310
- logger: this.logger,
1311
- });
1312
- resp = parseResponse(
1313
- respBody,
1314
- unmarshalDeleteExchangeFilterResponseSchema
1315
- );
1316
- };
1317
- await executeCall(call, options);
1318
- if (resp === undefined) {
1319
- throw new Error('operation completed without a result.');
1320
- }
1321
- return resp;
1322
- }
1323
-
1324
- /** Delete a file */
1325
- async deleteFile(
1326
- req: DeleteFileRequest,
1327
- options?: CallOptions
1328
- ): Promise<DeleteFileRequest_Response> {
1329
- const url = `${this.host}/api/2.0/marketplace-provider/files/${req.fileId ?? ''}`;
1330
- let resp: DeleteFileRequest_Response | undefined;
1331
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1332
- const headers = new Headers();
1333
- if (this.workspaceId !== undefined) {
1334
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1335
- }
1336
- headers.set('User-Agent', this.userAgent);
1337
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
1338
- const respBody = await executeHttpCall({
1339
- request: httpReq,
1340
- httpClient: this.httpClient,
1341
- logger: this.logger,
1342
- });
1343
- resp = parseResponse(respBody, unmarshalDeleteFileRequest_ResponseSchema);
1344
- };
1345
- await executeCall(call, options);
1346
- if (resp === undefined) {
1347
- throw new Error('operation completed without a result.');
1348
- }
1349
- return resp;
1350
- }
1351
-
1352
- /** Delete a listing */
1353
- async deleteListing(
1354
- req: DeleteListingRequest,
1355
- options?: CallOptions
1356
- ): Promise<DeleteListingRequest_Response> {
1357
- const url = `${this.host}/api/2.0/marketplace-provider/listings/${req.id ?? ''}`;
1358
- let resp: DeleteListingRequest_Response | undefined;
1359
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1360
- const headers = new Headers();
1361
- if (this.workspaceId !== undefined) {
1362
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1363
- }
1364
- headers.set('User-Agent', this.userAgent);
1365
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
1366
- const respBody = await executeHttpCall({
1367
- request: httpReq,
1368
- httpClient: this.httpClient,
1369
- logger: this.logger,
1370
- });
1371
- resp = parseResponse(
1372
- respBody,
1373
- unmarshalDeleteListingRequest_ResponseSchema
1374
- );
1375
- };
1376
- await executeCall(call, options);
1377
- if (resp === undefined) {
1378
- throw new Error('operation completed without a result.');
1379
- }
1380
- return resp;
1381
- }
1382
-
1383
- /** Delete provider */
1384
- async deleteProvider(
1385
- req: DeleteProviderRequest,
1386
- options?: CallOptions
1387
- ): Promise<DeleteProviderRequest_Response> {
1388
- const url = `${this.host}/api/2.0/marketplace-provider/providers/${req.id ?? ''}`;
1389
- let resp: DeleteProviderRequest_Response | undefined;
1390
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1391
- const headers = new Headers();
1392
- if (this.workspaceId !== undefined) {
1393
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1394
- }
1395
- headers.set('User-Agent', this.userAgent);
1396
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
1397
- const respBody = await executeHttpCall({
1398
- request: httpReq,
1399
- httpClient: this.httpClient,
1400
- logger: this.logger,
1401
- });
1402
- resp = parseResponse(
1403
- respBody,
1404
- unmarshalDeleteProviderRequest_ResponseSchema
1405
- );
1406
- };
1407
- await executeCall(call, options);
1408
- if (resp === undefined) {
1409
- throw new Error('operation completed without a result.');
1410
- }
1411
- return resp;
1412
- }
1413
-
1414
- /** Get an exchange. */
1415
- async getExchange(
1416
- req: GetExchangeRequest,
1417
- options?: CallOptions
1418
- ): Promise<GetExchangeResponse> {
1419
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges/${req.id ?? ''}`;
1420
- let resp: GetExchangeResponse | undefined;
1421
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1422
- const headers = new Headers();
1423
- if (this.workspaceId !== undefined) {
1424
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1425
- }
1426
- headers.set('User-Agent', this.userAgent);
1427
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1428
- const respBody = await executeHttpCall({
1429
- request: httpReq,
1430
- httpClient: this.httpClient,
1431
- logger: this.logger,
1432
- });
1433
- resp = parseResponse(respBody, unmarshalGetExchangeResponseSchema);
1434
- };
1435
- await executeCall(call, options);
1436
- if (resp === undefined) {
1437
- throw new Error('operation completed without a result.');
1438
- }
1439
- return resp;
1440
- }
1441
-
1442
- /** Get a file */
1443
- async getFile(
1444
- req: GetFileRequest,
1445
- options?: CallOptions
1446
- ): Promise<GetFileRequest_Response> {
1447
- const url = `${this.host}/api/2.0/marketplace-provider/files/${req.fileId ?? ''}`;
1448
- let resp: GetFileRequest_Response | undefined;
1449
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1450
- const headers = new Headers();
1451
- if (this.workspaceId !== undefined) {
1452
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1453
- }
1454
- headers.set('User-Agent', this.userAgent);
1455
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1456
- const respBody = await executeHttpCall({
1457
- request: httpReq,
1458
- httpClient: this.httpClient,
1459
- logger: this.logger,
1460
- });
1461
- resp = parseResponse(respBody, unmarshalGetFileRequest_ResponseSchema);
1462
- };
1463
- await executeCall(call, options);
1464
- if (resp === undefined) {
1465
- throw new Error('operation completed without a result.');
1466
- }
1467
- return resp;
1468
- }
1469
-
1470
- /** Get latest version of provider analytics dashboard. */
1471
- async getLatestVersionProviderAnalyticsDashboard(
1472
- _req: GetLatestVersionProviderAnalyticsDashboardRequest,
1473
- options?: CallOptions
1474
- ): Promise<GetLatestVersionProviderAnalyticsDashboardRequest_Response> {
1475
- const url = `${this.host}/api/2.0/marketplace-provider/analytics_dashboard/latest`;
1476
- let resp:
1477
- | GetLatestVersionProviderAnalyticsDashboardRequest_Response
1478
- | undefined;
1479
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1480
- const headers = new Headers();
1481
- if (this.workspaceId !== undefined) {
1482
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1483
- }
1484
- headers.set('User-Agent', this.userAgent);
1485
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1486
- const respBody = await executeHttpCall({
1487
- request: httpReq,
1488
- httpClient: this.httpClient,
1489
- logger: this.logger,
1490
- });
1491
- resp = parseResponse(
1492
- respBody,
1493
- unmarshalGetLatestVersionProviderAnalyticsDashboardRequest_ResponseSchema
1494
- );
1495
- };
1496
- await executeCall(call, options);
1497
- if (resp === undefined) {
1498
- throw new Error('operation completed without a result.');
1499
- }
1500
- return resp;
1501
- }
1502
-
1503
- /** Get a listing */
1504
- async getListing(
1505
- req: GetListingRequest,
1506
- options?: CallOptions
1507
- ): Promise<GetListingRequest_Response> {
1508
- const url = `${this.host}/api/2.0/marketplace-provider/listings/${req.id ?? ''}`;
1509
- let resp: GetListingRequest_Response | undefined;
1510
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1511
- const headers = new Headers();
1512
- if (this.workspaceId !== undefined) {
1513
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1514
- }
1515
- headers.set('User-Agent', this.userAgent);
1516
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1517
- const respBody = await executeHttpCall({
1518
- request: httpReq,
1519
- httpClient: this.httpClient,
1520
- logger: this.logger,
1521
- });
1522
- resp = parseResponse(respBody, unmarshalGetListingRequest_ResponseSchema);
1523
- };
1524
- await executeCall(call, options);
1525
- if (resp === undefined) {
1526
- throw new Error('operation completed without a result.');
1527
- }
1528
- return resp;
1529
- }
1530
-
1531
- /**
1532
- * List personalization requests to this provider.
1533
- * This will return all personalization requests, regardless of which listing they are for.
1534
- */
1535
- async getPersonalizationRequestsForProvider(
1536
- req: GetPersonalizationRequestsForProviderRequest,
1537
- options?: CallOptions
1538
- ): Promise<GetPersonalizationRequestsForProviderRequest_Response> {
1539
- const url = `${this.host}/api/2.0/marketplace-provider/personalization-requests`;
1540
- const params = new URLSearchParams();
1541
- if (req.pageToken !== undefined) {
1542
- params.append('page_token', req.pageToken);
1543
- }
1544
- if (req.pageSize !== undefined) {
1545
- params.append('page_size', String(req.pageSize));
1546
- }
1547
- const query = params.toString();
1548
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1549
- let resp: GetPersonalizationRequestsForProviderRequest_Response | undefined;
1550
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1551
- const headers = new Headers();
1552
- if (this.workspaceId !== undefined) {
1553
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1554
- }
1555
- headers.set('User-Agent', this.userAgent);
1556
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1557
- const respBody = await executeHttpCall({
1558
- request: httpReq,
1559
- httpClient: this.httpClient,
1560
- logger: this.logger,
1561
- });
1562
- resp = parseResponse(
1563
- respBody,
1564
- unmarshalGetPersonalizationRequestsForProviderRequest_ResponseSchema
1565
- );
1566
- };
1567
- await executeCall(call, options);
1568
- if (resp === undefined) {
1569
- throw new Error('operation completed without a result.');
1570
- }
1571
- return resp;
1572
- }
1573
-
1574
- async *getPersonalizationRequestsForProviderIter(
1575
- req: GetPersonalizationRequestsForProviderRequest,
1576
- options?: CallOptions
1577
- ): AsyncGenerator<PersonalizationRequest> {
1578
- const pageReq: GetPersonalizationRequestsForProviderRequest = {...req};
1579
- for (;;) {
1580
- const resp = await this.getPersonalizationRequestsForProvider(
1581
- pageReq,
1582
- options
1583
- );
1584
- for (const item of resp.personalizationRequests ?? []) {
1585
- yield item;
1586
- }
1587
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1588
- return;
1589
- }
1590
- pageReq.pageToken = resp.nextPageToken;
1591
- }
1592
- }
1593
-
1594
- /** Get provider profile */
1595
- async getProvider(
1596
- req: GetProviderRequest,
1597
- options?: CallOptions
1598
- ): Promise<GetProviderRequest_Response> {
1599
- const url = `${this.host}/api/2.0/marketplace-provider/providers/${req.id ?? ''}`;
1600
- let resp: GetProviderRequest_Response | undefined;
1601
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1602
- const headers = new Headers();
1603
- if (this.workspaceId !== undefined) {
1604
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1605
- }
1606
- headers.set('User-Agent', this.userAgent);
1607
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1608
- const respBody = await executeHttpCall({
1609
- request: httpReq,
1610
- httpClient: this.httpClient,
1611
- logger: this.logger,
1612
- });
1613
- resp = parseResponse(
1614
- respBody,
1615
- unmarshalGetProviderRequest_ResponseSchema
1616
- );
1617
- };
1618
- await executeCall(call, options);
1619
- if (resp === undefined) {
1620
- throw new Error('operation completed without a result.');
1621
- }
1622
- return resp;
1623
- }
1624
-
1625
- /** List exchange filter */
1626
- async listExchangeFilters(
1627
- req: ListExchangeFiltersRequest,
1628
- options?: CallOptions
1629
- ): Promise<ListExchangeFiltersResponse> {
1630
- const url = `${this.host}/api/2.0/marketplace-exchange/filters`;
1631
- const params = new URLSearchParams();
1632
- if (req.exchangeId !== undefined) {
1633
- params.append('exchange_id', req.exchangeId);
1634
- }
1635
- if (req.pageToken !== undefined) {
1636
- params.append('page_token', req.pageToken);
1637
- }
1638
- if (req.pageSize !== undefined) {
1639
- params.append('page_size', String(req.pageSize));
1640
- }
1641
- const query = params.toString();
1642
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1643
- let resp: ListExchangeFiltersResponse | undefined;
1644
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1645
- const headers = new Headers();
1646
- if (this.workspaceId !== undefined) {
1647
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1648
- }
1649
- headers.set('User-Agent', this.userAgent);
1650
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1651
- const respBody = await executeHttpCall({
1652
- request: httpReq,
1653
- httpClient: this.httpClient,
1654
- logger: this.logger,
1655
- });
1656
- resp = parseResponse(
1657
- respBody,
1658
- unmarshalListExchangeFiltersResponseSchema
1659
- );
1660
- };
1661
- await executeCall(call, options);
1662
- if (resp === undefined) {
1663
- throw new Error('operation completed without a result.');
1664
- }
1665
- return resp;
1666
- }
1667
-
1668
- async *listExchangeFiltersIter(
1669
- req: ListExchangeFiltersRequest,
1670
- options?: CallOptions
1671
- ): AsyncGenerator<ExchangeFilter> {
1672
- const pageReq: ListExchangeFiltersRequest = {...req};
1673
- for (;;) {
1674
- const resp = await this.listExchangeFilters(pageReq, options);
1675
- for (const item of resp.filters ?? []) {
1676
- yield item;
1677
- }
1678
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1679
- return;
1680
- }
1681
- pageReq.pageToken = resp.nextPageToken;
1682
- }
1683
- }
1684
-
1685
- /** List exchanges visible to provider */
1686
- async listExchanges(
1687
- req: ListExchangesRequest,
1688
- options?: CallOptions
1689
- ): Promise<ListExchangesResponse> {
1690
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges`;
1691
- const params = new URLSearchParams();
1692
- if (req.pageToken !== undefined) {
1693
- params.append('page_token', req.pageToken);
1694
- }
1695
- if (req.pageSize !== undefined) {
1696
- params.append('page_size', String(req.pageSize));
1697
- }
1698
- const query = params.toString();
1699
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1700
- let resp: ListExchangesResponse | undefined;
1701
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1702
- const headers = new Headers();
1703
- if (this.workspaceId !== undefined) {
1704
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1705
- }
1706
- headers.set('User-Agent', this.userAgent);
1707
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1708
- const respBody = await executeHttpCall({
1709
- request: httpReq,
1710
- httpClient: this.httpClient,
1711
- logger: this.logger,
1712
- });
1713
- resp = parseResponse(respBody, unmarshalListExchangesResponseSchema);
1714
- };
1715
- await executeCall(call, options);
1716
- if (resp === undefined) {
1717
- throw new Error('operation completed without a result.');
1718
- }
1719
- return resp;
1720
- }
1721
-
1722
- async *listExchangesIter(
1723
- req: ListExchangesRequest,
1724
- options?: CallOptions
1725
- ): AsyncGenerator<Exchange> {
1726
- const pageReq: ListExchangesRequest = {...req};
1727
- for (;;) {
1728
- const resp = await this.listExchanges(pageReq, options);
1729
- for (const item of resp.exchanges ?? []) {
1730
- yield item;
1731
- }
1732
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1733
- return;
1734
- }
1735
- pageReq.pageToken = resp.nextPageToken;
1736
- }
1737
- }
1738
-
1739
- /** List exchanges associated with a listing */
1740
- async listExchangesForListing(
1741
- req: ListExchangesForListingRequest,
1742
- options?: CallOptions
1743
- ): Promise<ListExchangesForListingResponse> {
1744
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges-for-listing`;
1745
- const params = new URLSearchParams();
1746
- if (req.listingId !== undefined) {
1747
- params.append('listing_id', req.listingId);
1748
- }
1749
- if (req.pageToken !== undefined) {
1750
- params.append('page_token', req.pageToken);
1751
- }
1752
- if (req.pageSize !== undefined) {
1753
- params.append('page_size', String(req.pageSize));
1754
- }
1755
- const query = params.toString();
1756
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1757
- let resp: ListExchangesForListingResponse | undefined;
1758
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1759
- const headers = new Headers();
1760
- if (this.workspaceId !== undefined) {
1761
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1762
- }
1763
- headers.set('User-Agent', this.userAgent);
1764
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1765
- const respBody = await executeHttpCall({
1766
- request: httpReq,
1767
- httpClient: this.httpClient,
1768
- logger: this.logger,
1769
- });
1770
- resp = parseResponse(
1771
- respBody,
1772
- unmarshalListExchangesForListingResponseSchema
1773
- );
1774
- };
1775
- await executeCall(call, options);
1776
- if (resp === undefined) {
1777
- throw new Error('operation completed without a result.');
1778
- }
1779
- return resp;
1780
- }
1781
-
1782
- async *listExchangesForListingIter(
1783
- req: ListExchangesForListingRequest,
1784
- options?: CallOptions
1785
- ): AsyncGenerator<ExchangeListing> {
1786
- const pageReq: ListExchangesForListingRequest = {...req};
1787
- for (;;) {
1788
- const resp = await this.listExchangesForListing(pageReq, options);
1789
- for (const item of resp.exchangeListing ?? []) {
1790
- yield item;
1791
- }
1792
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1793
- return;
1794
- }
1795
- pageReq.pageToken = resp.nextPageToken;
1796
- }
1797
- }
1798
-
1799
- /** List files attached to a parent entity. */
1800
- async listFiles(
1801
- req: ListFilesRequest,
1802
- options?: CallOptions
1803
- ): Promise<ListFilesRequest_Response> {
1804
- const url = `${this.host}/api/2.0/marketplace-provider/files`;
1805
- const params = new URLSearchParams();
1806
- if (req.fileParent !== undefined) {
1807
- flattenQueryParams(
1808
- 'file_parent',
1809
- marshalFileParentSchema.parse(req.fileParent),
1810
- params
1811
- );
1812
- }
1813
- if (req.pageToken !== undefined) {
1814
- params.append('page_token', req.pageToken);
1815
- }
1816
- if (req.pageSize !== undefined) {
1817
- params.append('page_size', String(req.pageSize));
1818
- }
1819
- const query = params.toString();
1820
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1821
- let resp: ListFilesRequest_Response | undefined;
1822
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1823
- const headers = new Headers();
1824
- if (this.workspaceId !== undefined) {
1825
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1826
- }
1827
- headers.set('User-Agent', this.userAgent);
1828
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1829
- const respBody = await executeHttpCall({
1830
- request: httpReq,
1831
- httpClient: this.httpClient,
1832
- logger: this.logger,
1833
- });
1834
- resp = parseResponse(respBody, unmarshalListFilesRequest_ResponseSchema);
1835
- };
1836
- await executeCall(call, options);
1837
- if (resp === undefined) {
1838
- throw new Error('operation completed without a result.');
1839
- }
1840
- return resp;
1841
- }
1842
-
1843
- async *listFilesIter(
1844
- req: ListFilesRequest,
1845
- options?: CallOptions
1846
- ): AsyncGenerator<FileInfo> {
1847
- const pageReq: ListFilesRequest = {...req};
1848
- for (;;) {
1849
- const resp = await this.listFiles(pageReq, options);
1850
- for (const item of resp.fileInfos ?? []) {
1851
- yield item;
1852
- }
1853
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1854
- return;
1855
- }
1856
- pageReq.pageToken = resp.nextPageToken;
1857
- }
1858
- }
1859
-
1860
- /** List listings owned by this provider */
1861
- async listListings(
1862
- req: ListListingsRequest,
1863
- options?: CallOptions
1864
- ): Promise<ListListingsRequest_Response> {
1865
- const url = `${this.host}/api/2.0/marketplace-provider/listings`;
1866
- const params = new URLSearchParams();
1867
- if (req.pageToken !== undefined) {
1868
- params.append('page_token', req.pageToken);
1869
- }
1870
- if (req.pageSize !== undefined) {
1871
- params.append('page_size', String(req.pageSize));
1872
- }
1873
- const query = params.toString();
1874
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1875
- let resp: ListListingsRequest_Response | undefined;
1876
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1877
- const headers = new Headers();
1878
- if (this.workspaceId !== undefined) {
1879
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1880
- }
1881
- headers.set('User-Agent', this.userAgent);
1882
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1883
- const respBody = await executeHttpCall({
1884
- request: httpReq,
1885
- httpClient: this.httpClient,
1886
- logger: this.logger,
1887
- });
1888
- resp = parseResponse(
1889
- respBody,
1890
- unmarshalListListingsRequest_ResponseSchema
1891
- );
1892
- };
1893
- await executeCall(call, options);
1894
- if (resp === undefined) {
1895
- throw new Error('operation completed without a result.');
1896
- }
1897
- return resp;
1898
- }
1899
-
1900
- async *listListingsIter(
1901
- req: ListListingsRequest,
1902
- options?: CallOptions
1903
- ): AsyncGenerator<Listing> {
1904
- const pageReq: ListListingsRequest = {...req};
1905
- for (;;) {
1906
- const resp = await this.listListings(pageReq, options);
1907
- for (const item of resp.listings ?? []) {
1908
- yield item;
1909
- }
1910
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1911
- return;
1912
- }
1913
- pageReq.pageToken = resp.nextPageToken;
1914
- }
1915
- }
1916
-
1917
- /** List listings associated with an exchange */
1918
- async listListingsForExchange(
1919
- req: ListListingsForExchangeRequest,
1920
- options?: CallOptions
1921
- ): Promise<ListListingsForExchangeResponse> {
1922
- const url = `${this.host}/api/2.0/marketplace-exchange/listings-for-exchange`;
1923
- const params = new URLSearchParams();
1924
- if (req.exchangeId !== undefined) {
1925
- params.append('exchange_id', req.exchangeId);
1926
- }
1927
- if (req.pageToken !== undefined) {
1928
- params.append('page_token', req.pageToken);
1929
- }
1930
- if (req.pageSize !== undefined) {
1931
- params.append('page_size', String(req.pageSize));
1932
- }
1933
- const query = params.toString();
1934
- const fullUrl = query !== '' ? `${url}?${query}` : url;
1935
- let resp: ListListingsForExchangeResponse | undefined;
1936
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1937
- const headers = new Headers();
1938
- if (this.workspaceId !== undefined) {
1939
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1940
- }
1941
- headers.set('User-Agent', this.userAgent);
1942
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
1943
- const respBody = await executeHttpCall({
1944
- request: httpReq,
1945
- httpClient: this.httpClient,
1946
- logger: this.logger,
1947
- });
1948
- resp = parseResponse(
1949
- respBody,
1950
- unmarshalListListingsForExchangeResponseSchema
1951
- );
1952
- };
1953
- await executeCall(call, options);
1954
- if (resp === undefined) {
1955
- throw new Error('operation completed without a result.');
1956
- }
1957
- return resp;
1958
- }
1959
-
1960
- async *listListingsForExchangeIter(
1961
- req: ListListingsForExchangeRequest,
1962
- options?: CallOptions
1963
- ): AsyncGenerator<ExchangeListing> {
1964
- const pageReq: ListListingsForExchangeRequest = {...req};
1965
- for (;;) {
1966
- const resp = await this.listListingsForExchange(pageReq, options);
1967
- for (const item of resp.exchangeListings ?? []) {
1968
- yield item;
1969
- }
1970
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
1971
- return;
1972
- }
1973
- pageReq.pageToken = resp.nextPageToken;
1974
- }
1975
- }
1976
-
1977
- /** Get provider analytics dashboard. */
1978
- async listProviderAnalyticsDashboard(
1979
- _req: ListProviderAnalyticsDashboardRequest,
1980
- options?: CallOptions
1981
- ): Promise<ListProviderAnalyticsDashboardRequest_Response> {
1982
- const url = `${this.host}/api/2.0/marketplace-provider/analytics_dashboard`;
1983
- let resp: ListProviderAnalyticsDashboardRequest_Response | undefined;
1984
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1985
- const headers = new Headers();
1986
- if (this.workspaceId !== undefined) {
1987
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1988
- }
1989
- headers.set('User-Agent', this.userAgent);
1990
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1991
- const respBody = await executeHttpCall({
1992
- request: httpReq,
1993
- httpClient: this.httpClient,
1994
- logger: this.logger,
1995
- });
1996
- resp = parseResponse(
1997
- respBody,
1998
- unmarshalListProviderAnalyticsDashboardRequest_ResponseSchema
1999
- );
2000
- };
2001
- await executeCall(call, options);
2002
- if (resp === undefined) {
2003
- throw new Error('operation completed without a result.');
2004
- }
2005
- return resp;
2006
- }
2007
-
2008
- /** List provider profiles for account. */
2009
- async listProviders(
2010
- req: ListProvidersRequest,
2011
- options?: CallOptions
2012
- ): Promise<ListProvidersRequest_Response> {
2013
- const url = `${this.host}/api/2.0/marketplace-provider/providers`;
2014
- const params = new URLSearchParams();
2015
- if (req.pageToken !== undefined) {
2016
- params.append('page_token', req.pageToken);
2017
- }
2018
- if (req.pageSize !== undefined) {
2019
- params.append('page_size', String(req.pageSize));
2020
- }
2021
- const query = params.toString();
2022
- const fullUrl = query !== '' ? `${url}?${query}` : url;
2023
- let resp: ListProvidersRequest_Response | undefined;
2024
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2025
- const headers = new Headers();
2026
- if (this.workspaceId !== undefined) {
2027
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2028
- }
2029
- headers.set('User-Agent', this.userAgent);
2030
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
2031
- const respBody = await executeHttpCall({
2032
- request: httpReq,
2033
- httpClient: this.httpClient,
2034
- logger: this.logger,
2035
- });
2036
- resp = parseResponse(
2037
- respBody,
2038
- unmarshalListProvidersRequest_ResponseSchema
2039
- );
2040
- };
2041
- await executeCall(call, options);
2042
- if (resp === undefined) {
2043
- throw new Error('operation completed without a result.');
2044
- }
2045
- return resp;
2046
- }
2047
-
2048
- async *listProvidersIter(
2049
- req: ListProvidersRequest,
2050
- options?: CallOptions
2051
- ): AsyncGenerator<ProviderInfo> {
2052
- const pageReq: ListProvidersRequest = {...req};
2053
- for (;;) {
2054
- const resp = await this.listProviders(pageReq, options);
2055
- for (const item of resp.providers ?? []) {
2056
- yield item;
2057
- }
2058
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
2059
- return;
2060
- }
2061
- pageReq.pageToken = resp.nextPageToken;
2062
- }
2063
- }
2064
-
2065
- /** Disassociate an exchange with a listing */
2066
- async removeExchangeForListing(
2067
- req: RemoveExchangeForListingRequest,
2068
- options?: CallOptions
2069
- ): Promise<RemoveExchangeForListingResponse> {
2070
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges-for-listing/${req.id ?? ''}`;
2071
- let resp: RemoveExchangeForListingResponse | undefined;
2072
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2073
- const headers = new Headers();
2074
- if (this.workspaceId !== undefined) {
2075
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2076
- }
2077
- headers.set('User-Agent', this.userAgent);
2078
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
2079
- const respBody = await executeHttpCall({
2080
- request: httpReq,
2081
- httpClient: this.httpClient,
2082
- logger: this.logger,
2083
- });
2084
- resp = parseResponse(
2085
- respBody,
2086
- unmarshalRemoveExchangeForListingResponseSchema
2087
- );
2088
- };
2089
- await executeCall(call, options);
2090
- if (resp === undefined) {
2091
- throw new Error('operation completed without a result.');
2092
- }
2093
- return resp;
2094
- }
2095
-
2096
- /** Update an exchange */
2097
- async updateExchange(
2098
- req: UpdateExchangeRequest,
2099
- options?: CallOptions
2100
- ): Promise<UpdateExchangeResponse> {
2101
- const url = `${this.host}/api/2.0/marketplace-exchange/exchanges/${req.id ?? ''}`;
2102
- const body = marshalRequest(req, marshalUpdateExchangeRequestSchema);
2103
- let resp: UpdateExchangeResponse | undefined;
2104
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2105
- const headers = new Headers({'Content-Type': 'application/json'});
2106
- if (this.workspaceId !== undefined) {
2107
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2108
- }
2109
- headers.set('User-Agent', this.userAgent);
2110
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2111
- const respBody = await executeHttpCall({
2112
- request: httpReq,
2113
- httpClient: this.httpClient,
2114
- logger: this.logger,
2115
- });
2116
- resp = parseResponse(respBody, unmarshalUpdateExchangeResponseSchema);
2117
- };
2118
- await executeCall(call, options);
2119
- if (resp === undefined) {
2120
- throw new Error('operation completed without a result.');
2121
- }
2122
- return resp;
2123
- }
2124
-
2125
- /** Update an exchange filter. */
2126
- async updateExchangeFilter(
2127
- req: UpdateExchangeFilterRequest,
2128
- options?: CallOptions
2129
- ): Promise<UpdateExchangeFilterResponse> {
2130
- const url = `${this.host}/api/2.0/marketplace-exchange/filters/${req.id ?? ''}`;
2131
- const body = marshalRequest(req, marshalUpdateExchangeFilterRequestSchema);
2132
- let resp: UpdateExchangeFilterResponse | undefined;
2133
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2134
- const headers = new Headers({'Content-Type': 'application/json'});
2135
- if (this.workspaceId !== undefined) {
2136
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2137
- }
2138
- headers.set('User-Agent', this.userAgent);
2139
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2140
- const respBody = await executeHttpCall({
2141
- request: httpReq,
2142
- httpClient: this.httpClient,
2143
- logger: this.logger,
2144
- });
2145
- resp = parseResponse(
2146
- respBody,
2147
- unmarshalUpdateExchangeFilterResponseSchema
2148
- );
2149
- };
2150
- await executeCall(call, options);
2151
- if (resp === undefined) {
2152
- throw new Error('operation completed without a result.');
2153
- }
2154
- return resp;
2155
- }
2156
-
2157
- /** Update a listing */
2158
- async updateListing(
2159
- req: UpdateListingRequest,
2160
- options?: CallOptions
2161
- ): Promise<UpdateListingRequest_Response> {
2162
- const url = `${this.host}/api/2.0/marketplace-provider/listings/${req.id ?? ''}`;
2163
- const body = marshalRequest(req, marshalUpdateListingRequestSchema);
2164
- let resp: UpdateListingRequest_Response | undefined;
2165
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2166
- const headers = new Headers({'Content-Type': 'application/json'});
2167
- if (this.workspaceId !== undefined) {
2168
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2169
- }
2170
- headers.set('User-Agent', this.userAgent);
2171
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2172
- const respBody = await executeHttpCall({
2173
- request: httpReq,
2174
- httpClient: this.httpClient,
2175
- logger: this.logger,
2176
- });
2177
- resp = parseResponse(
2178
- respBody,
2179
- unmarshalUpdateListingRequest_ResponseSchema
2180
- );
2181
- };
2182
- await executeCall(call, options);
2183
- if (resp === undefined) {
2184
- throw new Error('operation completed without a result.');
2185
- }
2186
- return resp;
2187
- }
2188
-
2189
- /** Update personalization request. This method only permits updating the status of the request. */
2190
- async updatePersonalizationRequestStatus(
2191
- req: UpdatePersonalizationRequestStatusRequest,
2192
- options?: CallOptions
2193
- ): Promise<UpdatePersonalizationRequestStatusRequest_Response> {
2194
- const url = `${this.host}/api/2.0/marketplace-provider/listings/${req.listingId ?? ''}/personalization-requests/${req.requestId ?? ''}/request-status`;
2195
- const body = marshalRequest(
2196
- req,
2197
- marshalUpdatePersonalizationRequestStatusRequestSchema
2198
- );
2199
- let resp: UpdatePersonalizationRequestStatusRequest_Response | undefined;
2200
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2201
- const headers = new Headers({'Content-Type': 'application/json'});
2202
- if (this.workspaceId !== undefined) {
2203
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2204
- }
2205
- headers.set('User-Agent', this.userAgent);
2206
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2207
- const respBody = await executeHttpCall({
2208
- request: httpReq,
2209
- httpClient: this.httpClient,
2210
- logger: this.logger,
2211
- });
2212
- resp = parseResponse(
2213
- respBody,
2214
- unmarshalUpdatePersonalizationRequestStatusRequest_ResponseSchema
2215
- );
2216
- };
2217
- await executeCall(call, options);
2218
- if (resp === undefined) {
2219
- throw new Error('operation completed without a result.');
2220
- }
2221
- return resp;
2222
- }
2223
-
2224
- /** Update provider profile */
2225
- async updateProvider(
2226
- req: UpdateProviderRequest,
2227
- options?: CallOptions
2228
- ): Promise<UpdateProviderRequest_Response> {
2229
- const url = `${this.host}/api/2.0/marketplace-provider/providers/${req.id ?? ''}`;
2230
- const body = marshalRequest(req, marshalUpdateProviderRequestSchema);
2231
- let resp: UpdateProviderRequest_Response | undefined;
2232
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2233
- const headers = new Headers({'Content-Type': 'application/json'});
2234
- if (this.workspaceId !== undefined) {
2235
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2236
- }
2237
- headers.set('User-Agent', this.userAgent);
2238
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2239
- const respBody = await executeHttpCall({
2240
- request: httpReq,
2241
- httpClient: this.httpClient,
2242
- logger: this.logger,
2243
- });
2244
- resp = parseResponse(
2245
- respBody,
2246
- unmarshalUpdateProviderRequest_ResponseSchema
2247
- );
2248
- };
2249
- await executeCall(call, options);
2250
- if (resp === undefined) {
2251
- throw new Error('operation completed without a result.');
2252
- }
2253
- return resp;
2254
- }
2255
-
2256
- /** Update provider analytics dashboard. */
2257
- async updateProviderAnalyticsDashboard(
2258
- req: UpdateProviderAnalyticsDashboardRequest,
2259
- options?: CallOptions
2260
- ): Promise<UpdateProviderAnalyticsDashboardRequest_Response> {
2261
- const url = `${this.host}/api/2.0/marketplace-provider/analytics_dashboard/${req.id ?? ''}`;
2262
- const body = marshalRequest(
2263
- req,
2264
- marshalUpdateProviderAnalyticsDashboardRequestSchema
2265
- );
2266
- let resp: UpdateProviderAnalyticsDashboardRequest_Response | undefined;
2267
- const call = async (callSignal?: AbortSignal): Promise<void> => {
2268
- const headers = new Headers({'Content-Type': 'application/json'});
2269
- if (this.workspaceId !== undefined) {
2270
- headers.set('X-Databricks-Org-Id', this.workspaceId);
2271
- }
2272
- headers.set('User-Agent', this.userAgent);
2273
- const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
2274
- const respBody = await executeHttpCall({
2275
- request: httpReq,
2276
- httpClient: this.httpClient,
2277
- logger: this.logger,
2278
- });
2279
- resp = parseResponse(
2280
- respBody,
2281
- unmarshalUpdateProviderAnalyticsDashboardRequest_ResponseSchema
2282
- );
2283
- };
2284
- await executeCall(call, options);
2285
- if (resp === undefined) {
2286
- throw new Error('operation completed without a result.');
2287
- }
2288
- return resp;
2289
- }
2290
- }