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

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