@databricks/sdk-sharing 0.1.0-dev.3 → 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,1198 +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
- } from './utils';
18
- import pkgJson from '../../package.json' with {type: 'json'};
19
- import type {
20
- CreateFederationPolicyRequest,
21
- CreateProviderRequest,
22
- CreateRecipientRequest,
23
- CreateShareRequest,
24
- DeleteFederationPolicyRequest,
25
- DeleteProviderRequest,
26
- DeleteProviderResponse,
27
- DeleteRecipientRequest,
28
- DeleteRecipientResponse,
29
- DeleteShareRequest,
30
- DeleteShareResponse,
31
- FederationPolicy,
32
- GetActivationUrlInfoRequest,
33
- GetActivationUrlInfoResponse,
34
- GetFederationPolicyRequest,
35
- GetProviderRequest,
36
- GetRecipientRequest,
37
- GetRecipientSharePermissionsResponse,
38
- GetSharePermissionsResponse,
39
- GetShareRequest,
40
- ListFederationPoliciesRequest,
41
- ListFederationPoliciesResponse,
42
- ListProviderShareAssetsRequest,
43
- ListProviderShareAssetsResponse,
44
- ListProviderSharesRequest,
45
- ListProviderSharesResponse,
46
- ListProvidersRequest,
47
- ListProvidersResponse,
48
- ListRecipientSharePermissionsRequest,
49
- ListRecipientsRequest,
50
- ListRecipientsResponse,
51
- ListSharePermissionsRequest,
52
- ListSharesRequest,
53
- ListSharesResponse,
54
- ProviderInfo,
55
- ProviderShare,
56
- RecipientInfo,
57
- RetrieveToken,
58
- RetrieveTokenResponse,
59
- RotateRecipientTokenRequest,
60
- ShareInfo,
61
- UpdateProviderRequest,
62
- UpdateRecipientRequest,
63
- UpdateSharePermissionsRequest,
64
- UpdateSharePermissionsResponse,
65
- UpdateShareRequest,
66
- } from './model';
67
- import {
68
- marshalCreateProviderRequestSchema,
69
- marshalCreateRecipientRequestSchema,
70
- marshalCreateShareRequestSchema,
71
- marshalFederationPolicySchema,
72
- marshalRotateRecipientTokenRequestSchema,
73
- marshalUpdateProviderRequestSchema,
74
- marshalUpdateRecipientRequestSchema,
75
- marshalUpdateSharePermissionsRequestSchema,
76
- marshalUpdateShareRequestSchema,
77
- unmarshalDeleteProviderResponseSchema,
78
- unmarshalDeleteRecipientResponseSchema,
79
- unmarshalDeleteShareResponseSchema,
80
- unmarshalFederationPolicySchema,
81
- unmarshalGetActivationUrlInfoResponseSchema,
82
- unmarshalGetRecipientSharePermissionsResponseSchema,
83
- unmarshalGetSharePermissionsResponseSchema,
84
- unmarshalListFederationPoliciesResponseSchema,
85
- unmarshalListProviderShareAssetsResponseSchema,
86
- unmarshalListProviderSharesResponseSchema,
87
- unmarshalListProvidersResponseSchema,
88
- unmarshalListRecipientsResponseSchema,
89
- unmarshalListSharesResponseSchema,
90
- unmarshalProviderInfoSchema,
91
- unmarshalRecipientInfoSchema,
92
- unmarshalRetrieveTokenResponseSchema,
93
- unmarshalShareInfoSchema,
94
- unmarshalUpdateSharePermissionsResponseSchema,
95
- } from './model';
96
-
97
- // Package identity segment for this client to be used in the User-Agent header.
98
- const PACKAGE_SEGMENT = {
99
- key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
100
- value: pkgJson.version,
101
- };
102
-
103
- export class SharingClient {
104
- private readonly host: string;
105
- // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
106
- // When set, workspace-level methods send X-Databricks-Org-Id on every
107
- // request.
108
- private readonly workspaceId: string | undefined;
109
- private readonly httpClient: HttpClient;
110
- private readonly logger: Logger;
111
- // User-Agent header value. Composed once at construction from
112
- // createDefault() merged with this package's identity and the active
113
- // credential's name.
114
- private readonly userAgent: string;
115
-
116
- constructor(options: ClientOptions) {
117
- if (options.host === undefined) {
118
- throw new Error('Host is required.');
119
- }
120
- this.host = options.host.replace(/\/$/, '');
121
- this.workspaceId = options.workspaceId;
122
- this.logger = options.logger ?? new NoOpLogger();
123
- const info = createDefault()
124
- .with(PACKAGE_SEGMENT)
125
- .with({key: 'sdk-js-auth', value: AUTH_VERSION})
126
- .with({key: 'auth', value: options.credentials?.name() ?? 'default'});
127
- this.userAgent = info.toString();
128
- this.httpClient = newHttpClient(options);
129
- }
130
-
131
- /**
132
- * Create a federation policy for an OIDC_FEDERATION recipient for sharing data from <Databricks> to non-<Databricks> recipients.
133
- * The caller must be the owner of the recipient.
134
- * When sharing data from <Databricks> to non-<Databricks> clients,
135
- * you can define a federation policy to authenticate non-<Databricks> recipients.
136
- * The federation policy validates OIDC claims in federated tokens and is defined at the recipient level.
137
- * This enables secretless sharing clients to authenticate using OIDC tokens.
138
- *
139
- * Supported scenarios for federation policies:
140
- * 1. **User-to-Machine (U2M) flow** (e.g., PowerBI): A user accesses a resource using their own identity.
141
- * 2. **Machine-to-Machine (M2M) flow** (e.g., OAuth App): An OAuth App accesses a resource using its own identity,
142
- * typically for tasks like running nightly jobs.
143
- *
144
- * For an overview, refer to:
145
- * - Blog post: Overview of feature: https://www.databricks.com/blog/announcing-oidc-token-federation-enhanced-delta-sharing-security
146
- *
147
- * For detailed configuration guides based on your use case:
148
- * - Creating a Federation Policy as a provider: https://docs.databricks.com/en/delta-sharing/create-recipient-oidc-fed
149
- * - Configuration and usage for Machine-to-Machine (M2M) applications (e.g., Python Delta Sharing Client): https://docs.databricks.com/aws/en/delta-sharing/sharing-over-oidc-m2m
150
- * - Configuration and usage for User-to-Machine (U2M) applications (e.g., PowerBI): https://docs.databricks.com/aws/en/delta-sharing/sharing-over-oidc-u2m
151
- */
152
- async createFederationPolicy(
153
- req: CreateFederationPolicyRequest,
154
- options?: CallOptions
155
- ): Promise<FederationPolicy> {
156
- const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies`;
157
- const body = marshalRequest(req.policy, marshalFederationPolicySchema);
158
- let resp: FederationPolicy | undefined;
159
- const call = async (callSignal?: AbortSignal): Promise<void> => {
160
- const headers = new Headers({'Content-Type': 'application/json'});
161
- if (this.workspaceId !== undefined) {
162
- headers.set('X-Databricks-Org-Id', this.workspaceId);
163
- }
164
- headers.set('User-Agent', this.userAgent);
165
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
166
- const respBody = await executeHttpCall({
167
- request: httpReq,
168
- httpClient: this.httpClient,
169
- logger: this.logger,
170
- });
171
- resp = parseResponse(respBody, unmarshalFederationPolicySchema);
172
- };
173
- await executeCall(call, options);
174
- if (resp === undefined) {
175
- throw new Error('operation completed without a result.');
176
- }
177
- return resp;
178
- }
179
-
180
- /**
181
- * Creates a new authentication provider minimally based on a name and authentication type.
182
- * The caller must be an admin on the metastore.
183
- */
184
- async createProvider(
185
- req: CreateProviderRequest,
186
- options?: CallOptions
187
- ): Promise<ProviderInfo> {
188
- const url = `${this.host}/api/2.1/unity-catalog/providers`;
189
- const body = marshalRequest(req, marshalCreateProviderRequestSchema);
190
- let resp: ProviderInfo | undefined;
191
- const call = async (callSignal?: AbortSignal): Promise<void> => {
192
- const headers = new Headers({'Content-Type': 'application/json'});
193
- if (this.workspaceId !== undefined) {
194
- headers.set('X-Databricks-Org-Id', this.workspaceId);
195
- }
196
- headers.set('User-Agent', this.userAgent);
197
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
198
- const respBody = await executeHttpCall({
199
- request: httpReq,
200
- httpClient: this.httpClient,
201
- logger: this.logger,
202
- });
203
- resp = parseResponse(respBody, unmarshalProviderInfoSchema);
204
- };
205
- await executeCall(call, options);
206
- if (resp === undefined) {
207
- throw new Error('operation completed without a result.');
208
- }
209
- return resp;
210
- }
211
-
212
- /**
213
- * Creates a new recipient with the delta sharing authentication type in the metastore.
214
- * The caller must be a metastore admin or have the **CREATE_RECIPIENT** privilege on the metastore.
215
- */
216
- async createRecipient(
217
- req: CreateRecipientRequest,
218
- options?: CallOptions
219
- ): Promise<RecipientInfo> {
220
- const url = `${this.host}/api/2.1/unity-catalog/recipients`;
221
- const body = marshalRequest(req, marshalCreateRecipientRequestSchema);
222
- let resp: RecipientInfo | undefined;
223
- const call = async (callSignal?: AbortSignal): Promise<void> => {
224
- const headers = new Headers({'Content-Type': 'application/json'});
225
- if (this.workspaceId !== undefined) {
226
- headers.set('X-Databricks-Org-Id', this.workspaceId);
227
- }
228
- headers.set('User-Agent', this.userAgent);
229
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
230
- const respBody = await executeHttpCall({
231
- request: httpReq,
232
- httpClient: this.httpClient,
233
- logger: this.logger,
234
- });
235
- resp = parseResponse(respBody, unmarshalRecipientInfoSchema);
236
- };
237
- await executeCall(call, options);
238
- if (resp === undefined) {
239
- throw new Error('operation completed without a result.');
240
- }
241
- return resp;
242
- }
243
-
244
- /**
245
- * Creates a new share for data objects. Data objects can be added after creation with **update**.
246
- * The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.
247
- */
248
- async createShare(
249
- req: CreateShareRequest,
250
- options?: CallOptions
251
- ): Promise<ShareInfo> {
252
- const url = `${this.host}/api/2.1/unity-catalog/shares`;
253
- const body = marshalRequest(req, marshalCreateShareRequestSchema);
254
- let resp: ShareInfo | undefined;
255
- const call = async (callSignal?: AbortSignal): Promise<void> => {
256
- const headers = new Headers({'Content-Type': 'application/json'});
257
- if (this.workspaceId !== undefined) {
258
- headers.set('X-Databricks-Org-Id', this.workspaceId);
259
- }
260
- headers.set('User-Agent', this.userAgent);
261
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
262
- const respBody = await executeHttpCall({
263
- request: httpReq,
264
- httpClient: this.httpClient,
265
- logger: this.logger,
266
- });
267
- resp = parseResponse(respBody, unmarshalShareInfoSchema);
268
- };
269
- await executeCall(call, options);
270
- if (resp === undefined) {
271
- throw new Error('operation completed without a result.');
272
- }
273
- return resp;
274
- }
275
-
276
- /**
277
- * Deletes an existing federation policy for an OIDC_FEDERATION recipient.
278
- * The caller must be the owner of the recipient.
279
- */
280
- async deleteFederationPolicy(
281
- req: DeleteFederationPolicyRequest,
282
- options?: CallOptions
283
- ): Promise<void> {
284
- const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
285
- const 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('DELETE', url, headers, callSignal);
292
- await executeHttpCall({
293
- request: httpReq,
294
- httpClient: this.httpClient,
295
- logger: this.logger,
296
- });
297
- };
298
- await executeCall(call, options);
299
- }
300
-
301
- /** Deletes an authentication provider, if the caller is a metastore admin or is the owner of the provider. */
302
- async deleteProvider(
303
- req: DeleteProviderRequest,
304
- options?: CallOptions
305
- ): Promise<DeleteProviderResponse> {
306
- const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
307
- let resp: DeleteProviderResponse | undefined;
308
- const call = async (callSignal?: AbortSignal): Promise<void> => {
309
- const headers = new Headers();
310
- if (this.workspaceId !== undefined) {
311
- headers.set('X-Databricks-Org-Id', this.workspaceId);
312
- }
313
- headers.set('User-Agent', this.userAgent);
314
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
315
- const respBody = await executeHttpCall({
316
- request: httpReq,
317
- httpClient: this.httpClient,
318
- logger: this.logger,
319
- });
320
- resp = parseResponse(respBody, unmarshalDeleteProviderResponseSchema);
321
- };
322
- await executeCall(call, options);
323
- if (resp === undefined) {
324
- throw new Error('operation completed without a result.');
325
- }
326
- return resp;
327
- }
328
-
329
- /** Deletes the specified recipient from the metastore. The caller must be the owner of the recipient. */
330
- async deleteRecipient(
331
- req: DeleteRecipientRequest,
332
- options?: CallOptions
333
- ): Promise<DeleteRecipientResponse> {
334
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
335
- let resp: DeleteRecipientResponse | undefined;
336
- const call = async (callSignal?: AbortSignal): Promise<void> => {
337
- const headers = new Headers();
338
- if (this.workspaceId !== undefined) {
339
- headers.set('X-Databricks-Org-Id', this.workspaceId);
340
- }
341
- headers.set('User-Agent', this.userAgent);
342
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
343
- const respBody = await executeHttpCall({
344
- request: httpReq,
345
- httpClient: this.httpClient,
346
- logger: this.logger,
347
- });
348
- resp = parseResponse(respBody, unmarshalDeleteRecipientResponseSchema);
349
- };
350
- await executeCall(call, options);
351
- if (resp === undefined) {
352
- throw new Error('operation completed without a result.');
353
- }
354
- return resp;
355
- }
356
-
357
- /** Deletes a data object share from the metastore. The caller must be an owner of the share. */
358
- async deleteShare(
359
- req: DeleteShareRequest,
360
- options?: CallOptions
361
- ): Promise<DeleteShareResponse> {
362
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}`;
363
- let resp: DeleteShareResponse | undefined;
364
- const call = async (callSignal?: AbortSignal): Promise<void> => {
365
- const headers = new Headers();
366
- if (this.workspaceId !== undefined) {
367
- headers.set('X-Databricks-Org-Id', this.workspaceId);
368
- }
369
- headers.set('User-Agent', this.userAgent);
370
- const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
371
- const respBody = await executeHttpCall({
372
- request: httpReq,
373
- httpClient: this.httpClient,
374
- logger: this.logger,
375
- });
376
- resp = parseResponse(respBody, unmarshalDeleteShareResponseSchema);
377
- };
378
- await executeCall(call, options);
379
- if (resp === undefined) {
380
- throw new Error('operation completed without a result.');
381
- }
382
- return resp;
383
- }
384
-
385
- /** Gets an activation URL for a share. */
386
- async getActivationUrlInfo(
387
- req: GetActivationUrlInfoRequest,
388
- options?: CallOptions
389
- ): Promise<GetActivationUrlInfoResponse> {
390
- const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation_info/${req.activationUrl ?? ''}`;
391
- let resp: GetActivationUrlInfoResponse | undefined;
392
- const call = async (callSignal?: AbortSignal): Promise<void> => {
393
- const headers = new Headers();
394
- if (this.workspaceId !== undefined) {
395
- headers.set('X-Databricks-Org-Id', this.workspaceId);
396
- }
397
- headers.set('User-Agent', this.userAgent);
398
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
399
- const respBody = await executeHttpCall({
400
- request: httpReq,
401
- httpClient: this.httpClient,
402
- logger: this.logger,
403
- });
404
- resp = parseResponse(
405
- respBody,
406
- unmarshalGetActivationUrlInfoResponseSchema
407
- );
408
- };
409
- await executeCall(call, options);
410
- if (resp === undefined) {
411
- throw new Error('operation completed without a result.');
412
- }
413
- return resp;
414
- }
415
-
416
- /**
417
- * Reads an existing federation policy for an OIDC_FEDERATION recipient for sharing data from <Databricks> to non-<Databricks> recipients.
418
- * The caller must have read access to the recipient.
419
- */
420
- async getFederationPolicy(
421
- req: GetFederationPolicyRequest,
422
- options?: CallOptions
423
- ): Promise<FederationPolicy> {
424
- const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
425
- let resp: FederationPolicy | undefined;
426
- const call = async (callSignal?: AbortSignal): Promise<void> => {
427
- const headers = new Headers();
428
- if (this.workspaceId !== undefined) {
429
- headers.set('X-Databricks-Org-Id', this.workspaceId);
430
- }
431
- headers.set('User-Agent', this.userAgent);
432
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
433
- const respBody = await executeHttpCall({
434
- request: httpReq,
435
- httpClient: this.httpClient,
436
- logger: this.logger,
437
- });
438
- resp = parseResponse(respBody, unmarshalFederationPolicySchema);
439
- };
440
- await executeCall(call, options);
441
- if (resp === undefined) {
442
- throw new Error('operation completed without a result.');
443
- }
444
- return resp;
445
- }
446
-
447
- /**
448
- * Gets a specific authentication provider.
449
- * The caller must supply the name of the provider, and must either be a metastore admin or the owner of the provider.
450
- */
451
- async getProvider(
452
- req: GetProviderRequest,
453
- options?: CallOptions
454
- ): Promise<ProviderInfo> {
455
- const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
456
- let resp: ProviderInfo | undefined;
457
- const call = async (callSignal?: AbortSignal): Promise<void> => {
458
- const headers = new Headers();
459
- if (this.workspaceId !== undefined) {
460
- headers.set('X-Databricks-Org-Id', this.workspaceId);
461
- }
462
- headers.set('User-Agent', this.userAgent);
463
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
464
- const respBody = await executeHttpCall({
465
- request: httpReq,
466
- httpClient: this.httpClient,
467
- logger: this.logger,
468
- });
469
- resp = parseResponse(respBody, unmarshalProviderInfoSchema);
470
- };
471
- await executeCall(call, options);
472
- if (resp === undefined) {
473
- throw new Error('operation completed without a result.');
474
- }
475
- return resp;
476
- }
477
-
478
- /**
479
- * Gets a share recipient from the metastore. The caller must be one of:
480
- * * A user with **USE_RECIPIENT** privilege on the metastore
481
- * * The owner of the share recipient
482
- * * A metastore admin
483
- */
484
- async getRecipient(
485
- req: GetRecipientRequest,
486
- options?: CallOptions
487
- ): Promise<RecipientInfo> {
488
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
489
- let resp: RecipientInfo | undefined;
490
- const call = async (callSignal?: AbortSignal): Promise<void> => {
491
- const headers = new Headers();
492
- if (this.workspaceId !== undefined) {
493
- headers.set('X-Databricks-Org-Id', this.workspaceId);
494
- }
495
- headers.set('User-Agent', this.userAgent);
496
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
497
- const respBody = await executeHttpCall({
498
- request: httpReq,
499
- httpClient: this.httpClient,
500
- logger: this.logger,
501
- });
502
- resp = parseResponse(respBody, unmarshalRecipientInfoSchema);
503
- };
504
- await executeCall(call, options);
505
- if (resp === undefined) {
506
- throw new Error('operation completed without a result.');
507
- }
508
- return resp;
509
- }
510
-
511
- /** Gets a data object share from the metastore. The caller must have the USE_SHARE privilege on the metastore or be the owner of the share. */
512
- async getShare(
513
- req: GetShareRequest,
514
- options?: CallOptions
515
- ): Promise<ShareInfo> {
516
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}`;
517
- const params = new URLSearchParams();
518
- if (req.includeSharedData !== undefined) {
519
- params.append('include_shared_data', String(req.includeSharedData));
520
- }
521
- const query = params.toString();
522
- const fullUrl = query !== '' ? `${url}?${query}` : url;
523
- let resp: ShareInfo | undefined;
524
- const call = async (callSignal?: AbortSignal): Promise<void> => {
525
- const headers = new Headers();
526
- if (this.workspaceId !== undefined) {
527
- headers.set('X-Databricks-Org-Id', this.workspaceId);
528
- }
529
- headers.set('User-Agent', this.userAgent);
530
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
531
- const respBody = await executeHttpCall({
532
- request: httpReq,
533
- httpClient: this.httpClient,
534
- logger: this.logger,
535
- });
536
- resp = parseResponse(respBody, unmarshalShareInfoSchema);
537
- };
538
- await executeCall(call, options);
539
- if (resp === undefined) {
540
- throw new Error('operation completed without a result.');
541
- }
542
- return resp;
543
- }
544
-
545
- /**
546
- * Lists federation policies for an OIDC_FEDERATION recipient for sharing data from <Databricks> to non-<Databricks> recipients.
547
- * The caller must have read access to the recipient.
548
- */
549
- async listFederationPolicies(
550
- req: ListFederationPoliciesRequest,
551
- options?: CallOptions
552
- ): Promise<ListFederationPoliciesResponse> {
553
- const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies`;
554
- const params = new URLSearchParams();
555
- if (req.maxResults !== undefined) {
556
- params.append('max_results', String(req.maxResults));
557
- }
558
- if (req.pageToken !== undefined) {
559
- params.append('page_token', req.pageToken);
560
- }
561
- const query = params.toString();
562
- const fullUrl = query !== '' ? `${url}?${query}` : url;
563
- let resp: ListFederationPoliciesResponse | undefined;
564
- const call = async (callSignal?: AbortSignal): Promise<void> => {
565
- const headers = new Headers();
566
- if (this.workspaceId !== undefined) {
567
- headers.set('X-Databricks-Org-Id', this.workspaceId);
568
- }
569
- headers.set('User-Agent', this.userAgent);
570
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
571
- const respBody = await executeHttpCall({
572
- request: httpReq,
573
- httpClient: this.httpClient,
574
- logger: this.logger,
575
- });
576
- resp = parseResponse(
577
- respBody,
578
- unmarshalListFederationPoliciesResponseSchema
579
- );
580
- };
581
- await executeCall(call, options);
582
- if (resp === undefined) {
583
- throw new Error('operation completed without a result.');
584
- }
585
- return resp;
586
- }
587
-
588
- async *listFederationPoliciesIter(
589
- req: ListFederationPoliciesRequest,
590
- options?: CallOptions
591
- ): AsyncGenerator<FederationPolicy> {
592
- const pageReq: ListFederationPoliciesRequest = {...req};
593
- for (;;) {
594
- const resp = await this.listFederationPolicies(pageReq, options);
595
- for (const item of resp.policies ?? []) {
596
- yield item;
597
- }
598
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
599
- return;
600
- }
601
- pageReq.pageToken = resp.nextPageToken;
602
- }
603
- }
604
-
605
- /**
606
- * Get arrays of assets associated with a specified provider's share.
607
- * The caller is the recipient of the share.
608
- */
609
- async listProviderShareAssets(
610
- req: ListProviderShareAssetsRequest,
611
- options?: CallOptions
612
- ): Promise<ListProviderShareAssetsResponse> {
613
- const url = `${this.host}/api/2.1/data-sharing/providers/${req.providerNameArg ?? ''}/shares/${req.shareNameArg ?? ''}`;
614
- const params = new URLSearchParams();
615
- if (req.tableMaxResults !== undefined) {
616
- params.append('table_max_results', String(req.tableMaxResults));
617
- }
618
- if (req.functionMaxResults !== undefined) {
619
- params.append('function_max_results', String(req.functionMaxResults));
620
- }
621
- if (req.volumeMaxResults !== undefined) {
622
- params.append('volume_max_results', String(req.volumeMaxResults));
623
- }
624
- if (req.notebookMaxResults !== undefined) {
625
- params.append('notebook_max_results', String(req.notebookMaxResults));
626
- }
627
- const query = params.toString();
628
- const fullUrl = query !== '' ? `${url}?${query}` : url;
629
- let resp: ListProviderShareAssetsResponse | undefined;
630
- const call = async (callSignal?: AbortSignal): Promise<void> => {
631
- const headers = new Headers();
632
- if (this.workspaceId !== undefined) {
633
- headers.set('X-Databricks-Org-Id', this.workspaceId);
634
- }
635
- headers.set('User-Agent', this.userAgent);
636
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
637
- const respBody = await executeHttpCall({
638
- request: httpReq,
639
- httpClient: this.httpClient,
640
- logger: this.logger,
641
- });
642
- resp = parseResponse(
643
- respBody,
644
- unmarshalListProviderShareAssetsResponseSchema
645
- );
646
- };
647
- await executeCall(call, options);
648
- if (resp === undefined) {
649
- throw new Error('operation completed without a result.');
650
- }
651
- return resp;
652
- }
653
-
654
- /**
655
- * Gets an array of a specified provider's shares within the metastore where:
656
- *
657
- * * the caller is a metastore admin, or
658
- * * the caller is the owner.
659
- */
660
- async listProviderShares(
661
- req: ListProviderSharesRequest,
662
- options?: CallOptions
663
- ): Promise<ListProviderSharesResponse> {
664
- const url = `${this.host}/api/2.1/unity-catalog/providers/${req.providerNameArg ?? ''}/shares`;
665
- const params = new URLSearchParams();
666
- if (req.maxResults !== undefined) {
667
- params.append('max_results', String(req.maxResults));
668
- }
669
- if (req.pageToken !== undefined) {
670
- params.append('page_token', req.pageToken);
671
- }
672
- const query = params.toString();
673
- const fullUrl = query !== '' ? `${url}?${query}` : url;
674
- let resp: ListProviderSharesResponse | undefined;
675
- const call = async (callSignal?: AbortSignal): Promise<void> => {
676
- const headers = new Headers();
677
- if (this.workspaceId !== undefined) {
678
- headers.set('X-Databricks-Org-Id', this.workspaceId);
679
- }
680
- headers.set('User-Agent', this.userAgent);
681
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
682
- const respBody = await executeHttpCall({
683
- request: httpReq,
684
- httpClient: this.httpClient,
685
- logger: this.logger,
686
- });
687
- resp = parseResponse(respBody, unmarshalListProviderSharesResponseSchema);
688
- };
689
- await executeCall(call, options);
690
- if (resp === undefined) {
691
- throw new Error('operation completed without a result.');
692
- }
693
- return resp;
694
- }
695
-
696
- async *listProviderSharesIter(
697
- req: ListProviderSharesRequest,
698
- options?: CallOptions
699
- ): AsyncGenerator<ProviderShare> {
700
- const pageReq: ListProviderSharesRequest = {...req};
701
- for (;;) {
702
- const resp = await this.listProviderShares(pageReq, options);
703
- for (const item of resp.shares ?? []) {
704
- yield item;
705
- }
706
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
707
- return;
708
- }
709
- pageReq.pageToken = resp.nextPageToken;
710
- }
711
- }
712
-
713
- /**
714
- * Gets an array of available authentication providers.
715
- * The caller must either be a metastore admin, have the **USE_PROVIDER** privilege on the providers,
716
- * or be the owner of the providers. Providers not owned by the caller and for which the caller does
717
- * not have the **USE_PROVIDER** privilege are not included in the response.
718
- * There is no guarantee of a specific ordering of the elements in the array.
719
- */
720
- async listProviders(
721
- req: ListProvidersRequest,
722
- options?: CallOptions
723
- ): Promise<ListProvidersResponse> {
724
- const url = `${this.host}/api/2.1/unity-catalog/providers`;
725
- const params = new URLSearchParams();
726
- if (req.dataProviderGlobalMetastoreId !== undefined) {
727
- params.append(
728
- 'data_provider_global_metastore_id',
729
- req.dataProviderGlobalMetastoreId
730
- );
731
- }
732
- if (req.maxResults !== undefined) {
733
- params.append('max_results', String(req.maxResults));
734
- }
735
- if (req.pageToken !== undefined) {
736
- params.append('page_token', req.pageToken);
737
- }
738
- const query = params.toString();
739
- const fullUrl = query !== '' ? `${url}?${query}` : url;
740
- let resp: ListProvidersResponse | undefined;
741
- const call = async (callSignal?: AbortSignal): Promise<void> => {
742
- const headers = new Headers();
743
- if (this.workspaceId !== undefined) {
744
- headers.set('X-Databricks-Org-Id', this.workspaceId);
745
- }
746
- headers.set('User-Agent', this.userAgent);
747
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
748
- const respBody = await executeHttpCall({
749
- request: httpReq,
750
- httpClient: this.httpClient,
751
- logger: this.logger,
752
- });
753
- resp = parseResponse(respBody, unmarshalListProvidersResponseSchema);
754
- };
755
- await executeCall(call, options);
756
- if (resp === undefined) {
757
- throw new Error('operation completed without a result.');
758
- }
759
- return resp;
760
- }
761
-
762
- async *listProvidersIter(
763
- req: ListProvidersRequest,
764
- options?: CallOptions
765
- ): AsyncGenerator<ProviderInfo> {
766
- const pageReq: ListProvidersRequest = {...req};
767
- for (;;) {
768
- const resp = await this.listProviders(pageReq, options);
769
- for (const item of resp.providers ?? []) {
770
- yield item;
771
- }
772
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
773
- return;
774
- }
775
- pageReq.pageToken = resp.nextPageToken;
776
- }
777
- }
778
-
779
- /** Gets the share permissions for the specified Recipient. The caller must have the **USE_RECIPIENT** privilege on the metastore or be the owner of the Recipient. */
780
- async listRecipientSharePermissions(
781
- req: ListRecipientSharePermissionsRequest,
782
- options?: CallOptions
783
- ): Promise<GetRecipientSharePermissionsResponse> {
784
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/share-permissions`;
785
- const params = new URLSearchParams();
786
- if (req.maxResults !== undefined) {
787
- params.append('max_results', String(req.maxResults));
788
- }
789
- if (req.pageToken !== undefined) {
790
- params.append('page_token', req.pageToken);
791
- }
792
- const query = params.toString();
793
- const fullUrl = query !== '' ? `${url}?${query}` : url;
794
- let resp: GetRecipientSharePermissionsResponse | undefined;
795
- const call = async (callSignal?: AbortSignal): Promise<void> => {
796
- const headers = new Headers();
797
- if (this.workspaceId !== undefined) {
798
- headers.set('X-Databricks-Org-Id', this.workspaceId);
799
- }
800
- headers.set('User-Agent', this.userAgent);
801
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
802
- const respBody = await executeHttpCall({
803
- request: httpReq,
804
- httpClient: this.httpClient,
805
- logger: this.logger,
806
- });
807
- resp = parseResponse(
808
- respBody,
809
- unmarshalGetRecipientSharePermissionsResponseSchema
810
- );
811
- };
812
- await executeCall(call, options);
813
- if (resp === undefined) {
814
- throw new Error('operation completed without a result.');
815
- }
816
- return resp;
817
- }
818
-
819
- /**
820
- * Gets an array of all share recipients within the current metastore where:
821
- *
822
- * * the caller is a metastore admin, or
823
- * * the caller is the owner.
824
- * There is no guarantee of a specific ordering of the elements in the array.
825
- */
826
- async listRecipients(
827
- req: ListRecipientsRequest,
828
- options?: CallOptions
829
- ): Promise<ListRecipientsResponse> {
830
- const url = `${this.host}/api/2.1/unity-catalog/recipients`;
831
- const params = new URLSearchParams();
832
- if (req.dataRecipientGlobalMetastoreId !== undefined) {
833
- params.append(
834
- 'data_recipient_global_metastore_id',
835
- req.dataRecipientGlobalMetastoreId
836
- );
837
- }
838
- if (req.maxResults !== undefined) {
839
- params.append('max_results', String(req.maxResults));
840
- }
841
- if (req.pageToken !== undefined) {
842
- params.append('page_token', req.pageToken);
843
- }
844
- const query = params.toString();
845
- const fullUrl = query !== '' ? `${url}?${query}` : url;
846
- let resp: ListRecipientsResponse | undefined;
847
- const call = async (callSignal?: AbortSignal): Promise<void> => {
848
- const headers = new Headers();
849
- if (this.workspaceId !== undefined) {
850
- headers.set('X-Databricks-Org-Id', this.workspaceId);
851
- }
852
- headers.set('User-Agent', this.userAgent);
853
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
854
- const respBody = await executeHttpCall({
855
- request: httpReq,
856
- httpClient: this.httpClient,
857
- logger: this.logger,
858
- });
859
- resp = parseResponse(respBody, unmarshalListRecipientsResponseSchema);
860
- };
861
- await executeCall(call, options);
862
- if (resp === undefined) {
863
- throw new Error('operation completed without a result.');
864
- }
865
- return resp;
866
- }
867
-
868
- async *listRecipientsIter(
869
- req: ListRecipientsRequest,
870
- options?: CallOptions
871
- ): AsyncGenerator<RecipientInfo> {
872
- const pageReq: ListRecipientsRequest = {...req};
873
- for (;;) {
874
- const resp = await this.listRecipients(pageReq, options);
875
- for (const item of resp.recipients ?? []) {
876
- yield item;
877
- }
878
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
879
- return;
880
- }
881
- pageReq.pageToken = resp.nextPageToken;
882
- }
883
- }
884
-
885
- /**
886
- * Gets the permissions for a data share from the metastore.
887
- * The caller must have the USE_SHARE privilege on the metastore or be the owner of the share.
888
- */
889
- async listSharePermissions(
890
- req: ListSharePermissionsRequest,
891
- options?: CallOptions
892
- ): Promise<GetSharePermissionsResponse> {
893
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
894
- const params = new URLSearchParams();
895
- if (req.maxResults !== undefined) {
896
- params.append('max_results', String(req.maxResults));
897
- }
898
- if (req.pageToken !== undefined) {
899
- params.append('page_token', req.pageToken);
900
- }
901
- const query = params.toString();
902
- const fullUrl = query !== '' ? `${url}?${query}` : url;
903
- let resp: GetSharePermissionsResponse | undefined;
904
- const call = async (callSignal?: AbortSignal): Promise<void> => {
905
- const headers = new Headers();
906
- if (this.workspaceId !== undefined) {
907
- headers.set('X-Databricks-Org-Id', this.workspaceId);
908
- }
909
- headers.set('User-Agent', this.userAgent);
910
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
911
- const respBody = await executeHttpCall({
912
- request: httpReq,
913
- httpClient: this.httpClient,
914
- logger: this.logger,
915
- });
916
- resp = parseResponse(
917
- respBody,
918
- unmarshalGetSharePermissionsResponseSchema
919
- );
920
- };
921
- await executeCall(call, options);
922
- if (resp === undefined) {
923
- throw new Error('operation completed without a result.');
924
- }
925
- return resp;
926
- }
927
-
928
- /**
929
- * Gets an array of data object shares from the metastore. If the caller has the USE_SHARE privilege on the metastore, all shares are returned. Otherwise, only shares owned by the caller are returned.
930
- * There is no guarantee of a specific ordering of the elements in the array.
931
- */
932
- async listShares(
933
- req: ListSharesRequest,
934
- options?: CallOptions
935
- ): Promise<ListSharesResponse> {
936
- const url = `${this.host}/api/2.1/unity-catalog/shares`;
937
- const params = new URLSearchParams();
938
- if (req.maxResults !== undefined) {
939
- params.append('max_results', String(req.maxResults));
940
- }
941
- if (req.pageToken !== undefined) {
942
- params.append('page_token', req.pageToken);
943
- }
944
- const query = params.toString();
945
- const fullUrl = query !== '' ? `${url}?${query}` : url;
946
- let resp: ListSharesResponse | undefined;
947
- const call = async (callSignal?: AbortSignal): Promise<void> => {
948
- const headers = new Headers();
949
- if (this.workspaceId !== undefined) {
950
- headers.set('X-Databricks-Org-Id', this.workspaceId);
951
- }
952
- headers.set('User-Agent', this.userAgent);
953
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
954
- const respBody = await executeHttpCall({
955
- request: httpReq,
956
- httpClient: this.httpClient,
957
- logger: this.logger,
958
- });
959
- resp = parseResponse(respBody, unmarshalListSharesResponseSchema);
960
- };
961
- await executeCall(call, options);
962
- if (resp === undefined) {
963
- throw new Error('operation completed without a result.');
964
- }
965
- return resp;
966
- }
967
-
968
- async *listSharesIter(
969
- req: ListSharesRequest,
970
- options?: CallOptions
971
- ): AsyncGenerator<ShareInfo> {
972
- const pageReq: ListSharesRequest = {...req};
973
- for (;;) {
974
- const resp = await this.listShares(pageReq, options);
975
- for (const item of resp.shares ?? []) {
976
- yield item;
977
- }
978
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
979
- return;
980
- }
981
- pageReq.pageToken = resp.nextPageToken;
982
- }
983
- }
984
-
985
- /**
986
- * Retrieve access token with an activation url.
987
- * This is a public API without any authentication.
988
- */
989
- async retrieveAccessToken(
990
- req: RetrieveToken,
991
- options?: CallOptions
992
- ): Promise<RetrieveTokenResponse> {
993
- const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation/${req.activationUrl ?? ''}`;
994
- let resp: RetrieveTokenResponse | undefined;
995
- const call = async (callSignal?: AbortSignal): Promise<void> => {
996
- const headers = new Headers();
997
- if (this.workspaceId !== undefined) {
998
- headers.set('X-Databricks-Org-Id', this.workspaceId);
999
- }
1000
- headers.set('User-Agent', this.userAgent);
1001
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
1002
- const respBody = await executeHttpCall({
1003
- request: httpReq,
1004
- httpClient: this.httpClient,
1005
- logger: this.logger,
1006
- });
1007
- resp = parseResponse(respBody, unmarshalRetrieveTokenResponseSchema);
1008
- };
1009
- await executeCall(call, options);
1010
- if (resp === undefined) {
1011
- throw new Error('operation completed without a result.');
1012
- }
1013
- return resp;
1014
- }
1015
-
1016
- /**
1017
- * Refreshes the specified recipient's delta sharing authentication token with the provided token info.
1018
- * The caller must be the owner of the recipient.
1019
- */
1020
- async rotateRecipientToken(
1021
- req: RotateRecipientTokenRequest,
1022
- options?: CallOptions
1023
- ): Promise<RecipientInfo> {
1024
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/rotate-token`;
1025
- const body = marshalRequest(req, marshalRotateRecipientTokenRequestSchema);
1026
- let resp: RecipientInfo | undefined;
1027
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1028
- const headers = new Headers({'Content-Type': 'application/json'});
1029
- if (this.workspaceId !== undefined) {
1030
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1031
- }
1032
- headers.set('User-Agent', this.userAgent);
1033
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
1034
- const respBody = await executeHttpCall({
1035
- request: httpReq,
1036
- httpClient: this.httpClient,
1037
- logger: this.logger,
1038
- });
1039
- resp = parseResponse(respBody, unmarshalRecipientInfoSchema);
1040
- };
1041
- await executeCall(call, options);
1042
- if (resp === undefined) {
1043
- throw new Error('operation completed without a result.');
1044
- }
1045
- return resp;
1046
- }
1047
-
1048
- /**
1049
- * Updates the information for an authentication provider, if the caller is a metastore admin or is the owner of the provider.
1050
- * If the update changes the provider name, the caller must be both a metastore admin and the owner of the provider.
1051
- */
1052
- async updateProvider(
1053
- req: UpdateProviderRequest,
1054
- options?: CallOptions
1055
- ): Promise<ProviderInfo> {
1056
- const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
1057
- const body = marshalRequest(req, marshalUpdateProviderRequestSchema);
1058
- let resp: ProviderInfo | undefined;
1059
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1060
- const headers = new Headers({'Content-Type': 'application/json'});
1061
- if (this.workspaceId !== undefined) {
1062
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1063
- }
1064
- headers.set('User-Agent', this.userAgent);
1065
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
1066
- const respBody = await executeHttpCall({
1067
- request: httpReq,
1068
- httpClient: this.httpClient,
1069
- logger: this.logger,
1070
- });
1071
- resp = parseResponse(respBody, unmarshalProviderInfoSchema);
1072
- };
1073
- await executeCall(call, options);
1074
- if (resp === undefined) {
1075
- throw new Error('operation completed without a result.');
1076
- }
1077
- return resp;
1078
- }
1079
-
1080
- /**
1081
- * Updates an existing recipient in the metastore. The caller must be a metastore admin or the owner of the recipient.
1082
- * If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.
1083
- */
1084
- async updateRecipient(
1085
- req: UpdateRecipientRequest,
1086
- options?: CallOptions
1087
- ): Promise<RecipientInfo> {
1088
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.nameArg ?? ''}`;
1089
- const body = marshalRequest(req, marshalUpdateRecipientRequestSchema);
1090
- let resp: RecipientInfo | undefined;
1091
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1092
- const headers = new Headers({'Content-Type': 'application/json'});
1093
- if (this.workspaceId !== undefined) {
1094
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1095
- }
1096
- headers.set('User-Agent', this.userAgent);
1097
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
1098
- const respBody = await executeHttpCall({
1099
- request: httpReq,
1100
- httpClient: this.httpClient,
1101
- logger: this.logger,
1102
- });
1103
- resp = parseResponse(respBody, unmarshalRecipientInfoSchema);
1104
- };
1105
- await executeCall(call, options);
1106
- if (resp === undefined) {
1107
- throw new Error('operation completed without a result.');
1108
- }
1109
- return resp;
1110
- }
1111
-
1112
- /**
1113
- * Updates the share with the changes and data objects in the request.
1114
- * The caller must be the owner of the share or a metastore admin.
1115
- *
1116
- * When the caller is a metastore admin, only the __owner__ field can be updated.
1117
- *
1118
- * In the case the share name is changed, **updateShare** requires that the caller is the owner of the share
1119
- * and has the CREATE_SHARE privilege.
1120
- *
1121
- * If there are notebook files in the share, the __storage_root__ field cannot be updated.
1122
- *
1123
- * For each table that is added through this method, the share owner must also have **SELECT** privilege on the table.
1124
- * This privilege must be maintained indefinitely for recipients to be able to access the table.
1125
- * Typically, you should use a group as the share owner.
1126
- *
1127
- * Table removals through **update** do not require additional privileges.
1128
- */
1129
- async updateShare(
1130
- req: UpdateShareRequest,
1131
- options?: CallOptions
1132
- ): Promise<ShareInfo> {
1133
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.nameArg ?? ''}`;
1134
- const body = marshalRequest(req, marshalUpdateShareRequestSchema);
1135
- let resp: ShareInfo | undefined;
1136
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1137
- const headers = new Headers({'Content-Type': 'application/json'});
1138
- if (this.workspaceId !== undefined) {
1139
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1140
- }
1141
- headers.set('User-Agent', this.userAgent);
1142
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
1143
- const respBody = await executeHttpCall({
1144
- request: httpReq,
1145
- httpClient: this.httpClient,
1146
- logger: this.logger,
1147
- });
1148
- resp = parseResponse(respBody, unmarshalShareInfoSchema);
1149
- };
1150
- await executeCall(call, options);
1151
- if (resp === undefined) {
1152
- throw new Error('operation completed without a result.');
1153
- }
1154
- return resp;
1155
- }
1156
-
1157
- /**
1158
- * Updates the permissions for a data share in the metastore.
1159
- * The caller must have both the USE_SHARE and SET_SHARE_PERMISSION privileges on the metastore,
1160
- * or be the owner of the share.
1161
- *
1162
- * For new recipient grants, the user must also be the owner of the recipients.
1163
- * recipient revocations do not require additional privileges.
1164
- */
1165
- async updateSharePermissions(
1166
- req: UpdateSharePermissionsRequest,
1167
- options?: CallOptions
1168
- ): Promise<UpdateSharePermissionsResponse> {
1169
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
1170
- const body = marshalRequest(
1171
- req,
1172
- marshalUpdateSharePermissionsRequestSchema
1173
- );
1174
- let resp: UpdateSharePermissionsResponse | undefined;
1175
- const call = async (callSignal?: AbortSignal): Promise<void> => {
1176
- const headers = new Headers({'Content-Type': 'application/json'});
1177
- if (this.workspaceId !== undefined) {
1178
- headers.set('X-Databricks-Org-Id', this.workspaceId);
1179
- }
1180
- headers.set('User-Agent', this.userAgent);
1181
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
1182
- const respBody = await executeHttpCall({
1183
- request: httpReq,
1184
- httpClient: this.httpClient,
1185
- logger: this.logger,
1186
- });
1187
- resp = parseResponse(
1188
- respBody,
1189
- unmarshalUpdateSharePermissionsResponseSchema
1190
- );
1191
- };
1192
- await executeCall(call, options);
1193
- if (resp === undefined) {
1194
- throw new Error('operation completed without a result.');
1195
- }
1196
- return resp;
1197
- }
1198
- }