@databricks/sdk-sharing 0.1.0-dev.1 → 0.1.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/v1/client.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
2
 
3
3
  import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
4
- import type {Call} from '@databricks/sdk-core/api';
5
4
  import {createDefault} from '@databricks/sdk-core/clientinfo';
6
5
  import type {Logger} from '@databricks/sdk-core/logger';
7
6
  import {NoOpLogger} from '@databricks/sdk-core/logger';
@@ -24,45 +23,45 @@ import type {
24
23
  CreateShareRequest,
25
24
  DeleteFederationPolicyRequest,
26
25
  DeleteProviderRequest,
27
- DeleteProviderRequest_Response,
26
+ DeleteProviderResponse,
28
27
  DeleteRecipientRequest,
29
- DeleteRecipientRequest_Response,
28
+ DeleteRecipientResponse,
30
29
  DeleteShareRequest,
31
- DeleteShareRequest_Response,
30
+ DeleteShareResponse,
32
31
  FederationPolicy,
33
32
  GetActivationUrlInfoRequest,
34
- GetActivationUrlInfoRequest_Response,
33
+ GetActivationUrlInfoResponse,
35
34
  GetFederationPolicyRequest,
36
35
  GetProviderRequest,
37
36
  GetRecipientRequest,
38
- GetRecipientSharePermissionsRequest,
39
- GetRecipientSharePermissionsRequest_Response,
40
- GetSharePermissionsRequest,
41
- GetSharePermissionsRequest_Response,
37
+ GetRecipientSharePermissionsResponse,
38
+ GetSharePermissionsResponse,
42
39
  GetShareRequest,
43
40
  ListFederationPoliciesRequest,
44
41
  ListFederationPoliciesResponse,
45
42
  ListProviderShareAssetsRequest,
46
43
  ListProviderShareAssetsResponse,
47
44
  ListProviderSharesRequest,
48
- ListProviderSharesRequest_Response,
45
+ ListProviderSharesResponse,
49
46
  ListProvidersRequest,
50
- ListProvidersRequest_Response,
47
+ ListProvidersResponse,
48
+ ListRecipientSharePermissionsRequest,
51
49
  ListRecipientsRequest,
52
- ListRecipientsRequest_Response,
50
+ ListRecipientsResponse,
51
+ ListSharePermissionsRequest,
53
52
  ListSharesRequest,
54
- ListSharesRequest_Response,
53
+ ListSharesResponse,
55
54
  ProviderInfo,
56
55
  ProviderShare,
57
56
  RecipientInfo,
58
57
  RetrieveToken,
59
- RetrieveToken_Response,
58
+ RetrieveTokenResponse,
60
59
  RotateRecipientTokenRequest,
61
60
  ShareInfo,
62
61
  UpdateProviderRequest,
63
62
  UpdateRecipientRequest,
64
63
  UpdateSharePermissionsRequest,
65
- UpdateSharePermissionsRequest_Response,
64
+ UpdateSharePermissionsResponse,
66
65
  UpdateShareRequest,
67
66
  } from './model';
68
67
  import {
@@ -75,24 +74,24 @@ import {
75
74
  marshalUpdateRecipientRequestSchema,
76
75
  marshalUpdateSharePermissionsRequestSchema,
77
76
  marshalUpdateShareRequestSchema,
78
- unmarshalDeleteProviderRequest_ResponseSchema,
79
- unmarshalDeleteRecipientRequest_ResponseSchema,
80
- unmarshalDeleteShareRequest_ResponseSchema,
77
+ unmarshalDeleteProviderResponseSchema,
78
+ unmarshalDeleteRecipientResponseSchema,
79
+ unmarshalDeleteShareResponseSchema,
81
80
  unmarshalFederationPolicySchema,
82
- unmarshalGetActivationUrlInfoRequest_ResponseSchema,
83
- unmarshalGetRecipientSharePermissionsRequest_ResponseSchema,
84
- unmarshalGetSharePermissionsRequest_ResponseSchema,
81
+ unmarshalGetActivationUrlInfoResponseSchema,
82
+ unmarshalGetRecipientSharePermissionsResponseSchema,
83
+ unmarshalGetSharePermissionsResponseSchema,
85
84
  unmarshalListFederationPoliciesResponseSchema,
86
85
  unmarshalListProviderShareAssetsResponseSchema,
87
- unmarshalListProviderSharesRequest_ResponseSchema,
88
- unmarshalListProvidersRequest_ResponseSchema,
89
- unmarshalListRecipientsRequest_ResponseSchema,
90
- unmarshalListSharesRequest_ResponseSchema,
86
+ unmarshalListProviderSharesResponseSchema,
87
+ unmarshalListProvidersResponseSchema,
88
+ unmarshalListRecipientsResponseSchema,
89
+ unmarshalListSharesResponseSchema,
91
90
  unmarshalProviderInfoSchema,
92
91
  unmarshalRecipientInfoSchema,
93
- unmarshalRetrieveToken_ResponseSchema,
92
+ unmarshalRetrieveTokenResponseSchema,
94
93
  unmarshalShareInfoSchema,
95
- unmarshalUpdateSharePermissionsRequest_ResponseSchema,
94
+ unmarshalUpdateSharePermissionsResponseSchema,
96
95
  } from './model';
97
96
 
98
97
  // Package identity segment for this client to be used in the User-Agent header.
@@ -157,7 +156,7 @@ export class SharingClient {
157
156
  const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies`;
158
157
  const body = marshalRequest(req.policy, marshalFederationPolicySchema);
159
158
  let resp: FederationPolicy | undefined;
160
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
159
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
161
160
  const headers = new Headers({'Content-Type': 'application/json'});
162
161
  if (this.workspaceId !== undefined) {
163
162
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -173,7 +172,7 @@ export class SharingClient {
173
172
  };
174
173
  await executeCall(call, options);
175
174
  if (resp === undefined) {
176
- throw new Error('API call completed without a result.');
175
+ throw new Error('operation completed without a result.');
177
176
  }
178
177
  return resp;
179
178
  }
@@ -189,7 +188,7 @@ export class SharingClient {
189
188
  const url = `${this.host}/api/2.1/unity-catalog/providers`;
190
189
  const body = marshalRequest(req, marshalCreateProviderRequestSchema);
191
190
  let resp: ProviderInfo | undefined;
192
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
191
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
193
192
  const headers = new Headers({'Content-Type': 'application/json'});
194
193
  if (this.workspaceId !== undefined) {
195
194
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -205,7 +204,7 @@ export class SharingClient {
205
204
  };
206
205
  await executeCall(call, options);
207
206
  if (resp === undefined) {
208
- throw new Error('API call completed without a result.');
207
+ throw new Error('operation completed without a result.');
209
208
  }
210
209
  return resp;
211
210
  }
@@ -221,7 +220,7 @@ export class SharingClient {
221
220
  const url = `${this.host}/api/2.1/unity-catalog/recipients`;
222
221
  const body = marshalRequest(req, marshalCreateRecipientRequestSchema);
223
222
  let resp: RecipientInfo | undefined;
224
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
223
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
225
224
  const headers = new Headers({'Content-Type': 'application/json'});
226
225
  if (this.workspaceId !== undefined) {
227
226
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -237,7 +236,7 @@ export class SharingClient {
237
236
  };
238
237
  await executeCall(call, options);
239
238
  if (resp === undefined) {
240
- throw new Error('API call completed without a result.');
239
+ throw new Error('operation completed without a result.');
241
240
  }
242
241
  return resp;
243
242
  }
@@ -253,7 +252,7 @@ export class SharingClient {
253
252
  const url = `${this.host}/api/2.1/unity-catalog/shares`;
254
253
  const body = marshalRequest(req, marshalCreateShareRequestSchema);
255
254
  let resp: ShareInfo | undefined;
256
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
255
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
257
256
  const headers = new Headers({'Content-Type': 'application/json'});
258
257
  if (this.workspaceId !== undefined) {
259
258
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -269,7 +268,7 @@ export class SharingClient {
269
268
  };
270
269
  await executeCall(call, options);
271
270
  if (resp === undefined) {
272
- throw new Error('API call completed without a result.');
271
+ throw new Error('operation completed without a result.');
273
272
  }
274
273
  return resp;
275
274
  }
@@ -283,7 +282,7 @@ export class SharingClient {
283
282
  options?: CallOptions
284
283
  ): Promise<void> {
285
284
  const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
286
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
285
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
287
286
  const headers = new Headers();
288
287
  if (this.workspaceId !== undefined) {
289
288
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -303,10 +302,10 @@ export class SharingClient {
303
302
  async deleteProvider(
304
303
  req: DeleteProviderRequest,
305
304
  options?: CallOptions
306
- ): Promise<DeleteProviderRequest_Response> {
305
+ ): Promise<DeleteProviderResponse> {
307
306
  const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
308
- let resp: DeleteProviderRequest_Response | undefined;
309
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
307
+ let resp: DeleteProviderResponse | undefined;
308
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
310
309
  const headers = new Headers();
311
310
  if (this.workspaceId !== undefined) {
312
311
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -318,14 +317,11 @@ export class SharingClient {
318
317
  httpClient: this.httpClient,
319
318
  logger: this.logger,
320
319
  });
321
- resp = parseResponse(
322
- respBody,
323
- unmarshalDeleteProviderRequest_ResponseSchema
324
- );
320
+ resp = parseResponse(respBody, unmarshalDeleteProviderResponseSchema);
325
321
  };
326
322
  await executeCall(call, options);
327
323
  if (resp === undefined) {
328
- throw new Error('API call completed without a result.');
324
+ throw new Error('operation completed without a result.');
329
325
  }
330
326
  return resp;
331
327
  }
@@ -334,10 +330,10 @@ export class SharingClient {
334
330
  async deleteRecipient(
335
331
  req: DeleteRecipientRequest,
336
332
  options?: CallOptions
337
- ): Promise<DeleteRecipientRequest_Response> {
333
+ ): Promise<DeleteRecipientResponse> {
338
334
  const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
339
- let resp: DeleteRecipientRequest_Response | undefined;
340
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
335
+ let resp: DeleteRecipientResponse | undefined;
336
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
341
337
  const headers = new Headers();
342
338
  if (this.workspaceId !== undefined) {
343
339
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -349,14 +345,11 @@ export class SharingClient {
349
345
  httpClient: this.httpClient,
350
346
  logger: this.logger,
351
347
  });
352
- resp = parseResponse(
353
- respBody,
354
- unmarshalDeleteRecipientRequest_ResponseSchema
355
- );
348
+ resp = parseResponse(respBody, unmarshalDeleteRecipientResponseSchema);
356
349
  };
357
350
  await executeCall(call, options);
358
351
  if (resp === undefined) {
359
- throw new Error('API call completed without a result.');
352
+ throw new Error('operation completed without a result.');
360
353
  }
361
354
  return resp;
362
355
  }
@@ -365,10 +358,10 @@ export class SharingClient {
365
358
  async deleteShare(
366
359
  req: DeleteShareRequest,
367
360
  options?: CallOptions
368
- ): Promise<DeleteShareRequest_Response> {
361
+ ): Promise<DeleteShareResponse> {
369
362
  const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}`;
370
- let resp: DeleteShareRequest_Response | undefined;
371
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
363
+ let resp: DeleteShareResponse | undefined;
364
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
372
365
  const headers = new Headers();
373
366
  if (this.workspaceId !== undefined) {
374
367
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -380,14 +373,11 @@ export class SharingClient {
380
373
  httpClient: this.httpClient,
381
374
  logger: this.logger,
382
375
  });
383
- resp = parseResponse(
384
- respBody,
385
- unmarshalDeleteShareRequest_ResponseSchema
386
- );
376
+ resp = parseResponse(respBody, unmarshalDeleteShareResponseSchema);
387
377
  };
388
378
  await executeCall(call, options);
389
379
  if (resp === undefined) {
390
- throw new Error('API call completed without a result.');
380
+ throw new Error('operation completed without a result.');
391
381
  }
392
382
  return resp;
393
383
  }
@@ -396,10 +386,10 @@ export class SharingClient {
396
386
  async getActivationUrlInfo(
397
387
  req: GetActivationUrlInfoRequest,
398
388
  options?: CallOptions
399
- ): Promise<GetActivationUrlInfoRequest_Response> {
389
+ ): Promise<GetActivationUrlInfoResponse> {
400
390
  const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation_info/${req.activationUrl ?? ''}`;
401
- let resp: GetActivationUrlInfoRequest_Response | undefined;
402
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
391
+ let resp: GetActivationUrlInfoResponse | undefined;
392
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
403
393
  const headers = new Headers();
404
394
  if (this.workspaceId !== undefined) {
405
395
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -413,12 +403,12 @@ export class SharingClient {
413
403
  });
414
404
  resp = parseResponse(
415
405
  respBody,
416
- unmarshalGetActivationUrlInfoRequest_ResponseSchema
406
+ unmarshalGetActivationUrlInfoResponseSchema
417
407
  );
418
408
  };
419
409
  await executeCall(call, options);
420
410
  if (resp === undefined) {
421
- throw new Error('API call completed without a result.');
411
+ throw new Error('operation completed without a result.');
422
412
  }
423
413
  return resp;
424
414
  }
@@ -433,7 +423,7 @@ export class SharingClient {
433
423
  ): Promise<FederationPolicy> {
434
424
  const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
435
425
  let resp: FederationPolicy | undefined;
436
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
426
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
437
427
  const headers = new Headers();
438
428
  if (this.workspaceId !== undefined) {
439
429
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -449,7 +439,7 @@ export class SharingClient {
449
439
  };
450
440
  await executeCall(call, options);
451
441
  if (resp === undefined) {
452
- throw new Error('API call completed without a result.');
442
+ throw new Error('operation completed without a result.');
453
443
  }
454
444
  return resp;
455
445
  }
@@ -464,7 +454,7 @@ export class SharingClient {
464
454
  ): Promise<ProviderInfo> {
465
455
  const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
466
456
  let resp: ProviderInfo | undefined;
467
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
457
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
468
458
  const headers = new Headers();
469
459
  if (this.workspaceId !== undefined) {
470
460
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -480,7 +470,7 @@ export class SharingClient {
480
470
  };
481
471
  await executeCall(call, options);
482
472
  if (resp === undefined) {
483
- throw new Error('API call completed without a result.');
473
+ throw new Error('operation completed without a result.');
484
474
  }
485
475
  return resp;
486
476
  }
@@ -497,7 +487,7 @@ export class SharingClient {
497
487
  ): Promise<RecipientInfo> {
498
488
  const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
499
489
  let resp: RecipientInfo | undefined;
500
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
490
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
501
491
  const headers = new Headers();
502
492
  if (this.workspaceId !== undefined) {
503
493
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -513,47 +503,7 @@ export class SharingClient {
513
503
  };
514
504
  await executeCall(call, options);
515
505
  if (resp === undefined) {
516
- throw new Error('API call completed without a result.');
517
- }
518
- return resp;
519
- }
520
-
521
- /** 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. */
522
- async getRecipientSharePermissions(
523
- req: GetRecipientSharePermissionsRequest,
524
- options?: CallOptions
525
- ): Promise<GetRecipientSharePermissionsRequest_Response> {
526
- const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/share-permissions`;
527
- const params = new URLSearchParams();
528
- if (req.maxResults !== undefined) {
529
- params.append('max_results', String(req.maxResults));
530
- }
531
- if (req.pageToken !== undefined) {
532
- params.append('page_token', req.pageToken);
533
- }
534
- const query = params.toString();
535
- const fullUrl = query !== '' ? `${url}?${query}` : url;
536
- let resp: GetRecipientSharePermissionsRequest_Response | undefined;
537
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
538
- const headers = new Headers();
539
- if (this.workspaceId !== undefined) {
540
- headers.set('X-Databricks-Org-Id', this.workspaceId);
541
- }
542
- headers.set('User-Agent', this.userAgent);
543
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
544
- const respBody = await executeHttpCall({
545
- request: httpReq,
546
- httpClient: this.httpClient,
547
- logger: this.logger,
548
- });
549
- resp = parseResponse(
550
- respBody,
551
- unmarshalGetRecipientSharePermissionsRequest_ResponseSchema
552
- );
553
- };
554
- await executeCall(call, options);
555
- if (resp === undefined) {
556
- throw new Error('API call completed without a result.');
506
+ throw new Error('operation completed without a result.');
557
507
  }
558
508
  return resp;
559
509
  }
@@ -571,7 +521,7 @@ export class SharingClient {
571
521
  const query = params.toString();
572
522
  const fullUrl = query !== '' ? `${url}?${query}` : url;
573
523
  let resp: ShareInfo | undefined;
574
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
524
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
575
525
  const headers = new Headers();
576
526
  if (this.workspaceId !== undefined) {
577
527
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -587,50 +537,7 @@ export class SharingClient {
587
537
  };
588
538
  await executeCall(call, options);
589
539
  if (resp === undefined) {
590
- throw new Error('API call completed without a result.');
591
- }
592
- return resp;
593
- }
594
-
595
- /**
596
- * Gets the permissions for a data share from the metastore.
597
- * The caller must have the USE_SHARE privilege on the metastore or be the owner of the share.
598
- */
599
- async getSharePermissions(
600
- req: GetSharePermissionsRequest,
601
- options?: CallOptions
602
- ): Promise<GetSharePermissionsRequest_Response> {
603
- const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
604
- const params = new URLSearchParams();
605
- if (req.maxResults !== undefined) {
606
- params.append('max_results', String(req.maxResults));
607
- }
608
- if (req.pageToken !== undefined) {
609
- params.append('page_token', req.pageToken);
610
- }
611
- const query = params.toString();
612
- const fullUrl = query !== '' ? `${url}?${query}` : url;
613
- let resp: GetSharePermissionsRequest_Response | undefined;
614
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
615
- const headers = new Headers();
616
- if (this.workspaceId !== undefined) {
617
- headers.set('X-Databricks-Org-Id', this.workspaceId);
618
- }
619
- headers.set('User-Agent', this.userAgent);
620
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
621
- const respBody = await executeHttpCall({
622
- request: httpReq,
623
- httpClient: this.httpClient,
624
- logger: this.logger,
625
- });
626
- resp = parseResponse(
627
- respBody,
628
- unmarshalGetSharePermissionsRequest_ResponseSchema
629
- );
630
- };
631
- await executeCall(call, options);
632
- if (resp === undefined) {
633
- throw new Error('API call completed without a result.');
540
+ throw new Error('operation completed without a result.');
634
541
  }
635
542
  return resp;
636
543
  }
@@ -654,7 +561,7 @@ export class SharingClient {
654
561
  const query = params.toString();
655
562
  const fullUrl = query !== '' ? `${url}?${query}` : url;
656
563
  let resp: ListFederationPoliciesResponse | undefined;
657
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
564
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
658
565
  const headers = new Headers();
659
566
  if (this.workspaceId !== undefined) {
660
567
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -673,7 +580,7 @@ export class SharingClient {
673
580
  };
674
581
  await executeCall(call, options);
675
582
  if (resp === undefined) {
676
- throw new Error('API call completed without a result.');
583
+ throw new Error('operation completed without a result.');
677
584
  }
678
585
  return resp;
679
586
  }
@@ -720,7 +627,7 @@ export class SharingClient {
720
627
  const query = params.toString();
721
628
  const fullUrl = query !== '' ? `${url}?${query}` : url;
722
629
  let resp: ListProviderShareAssetsResponse | undefined;
723
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
630
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
724
631
  const headers = new Headers();
725
632
  if (this.workspaceId !== undefined) {
726
633
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -739,7 +646,7 @@ export class SharingClient {
739
646
  };
740
647
  await executeCall(call, options);
741
648
  if (resp === undefined) {
742
- throw new Error('API call completed without a result.');
649
+ throw new Error('operation completed without a result.');
743
650
  }
744
651
  return resp;
745
652
  }
@@ -753,7 +660,7 @@ export class SharingClient {
753
660
  async listProviderShares(
754
661
  req: ListProviderSharesRequest,
755
662
  options?: CallOptions
756
- ): Promise<ListProviderSharesRequest_Response> {
663
+ ): Promise<ListProviderSharesResponse> {
757
664
  const url = `${this.host}/api/2.1/unity-catalog/providers/${req.providerNameArg ?? ''}/shares`;
758
665
  const params = new URLSearchParams();
759
666
  if (req.maxResults !== undefined) {
@@ -764,8 +671,8 @@ export class SharingClient {
764
671
  }
765
672
  const query = params.toString();
766
673
  const fullUrl = query !== '' ? `${url}?${query}` : url;
767
- let resp: ListProviderSharesRequest_Response | undefined;
768
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
674
+ let resp: ListProviderSharesResponse | undefined;
675
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
769
676
  const headers = new Headers();
770
677
  if (this.workspaceId !== undefined) {
771
678
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -777,14 +684,11 @@ export class SharingClient {
777
684
  httpClient: this.httpClient,
778
685
  logger: this.logger,
779
686
  });
780
- resp = parseResponse(
781
- respBody,
782
- unmarshalListProviderSharesRequest_ResponseSchema
783
- );
687
+ resp = parseResponse(respBody, unmarshalListProviderSharesResponseSchema);
784
688
  };
785
689
  await executeCall(call, options);
786
690
  if (resp === undefined) {
787
- throw new Error('API call completed without a result.');
691
+ throw new Error('operation completed without a result.');
788
692
  }
789
693
  return resp;
790
694
  }
@@ -816,7 +720,7 @@ export class SharingClient {
816
720
  async listProviders(
817
721
  req: ListProvidersRequest,
818
722
  options?: CallOptions
819
- ): Promise<ListProvidersRequest_Response> {
723
+ ): Promise<ListProvidersResponse> {
820
724
  const url = `${this.host}/api/2.1/unity-catalog/providers`;
821
725
  const params = new URLSearchParams();
822
726
  if (req.dataProviderGlobalMetastoreId !== undefined) {
@@ -833,8 +737,8 @@ export class SharingClient {
833
737
  }
834
738
  const query = params.toString();
835
739
  const fullUrl = query !== '' ? `${url}?${query}` : url;
836
- let resp: ListProvidersRequest_Response | undefined;
837
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
740
+ let resp: ListProvidersResponse | undefined;
741
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
838
742
  const headers = new Headers();
839
743
  if (this.workspaceId !== undefined) {
840
744
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -846,14 +750,11 @@ export class SharingClient {
846
750
  httpClient: this.httpClient,
847
751
  logger: this.logger,
848
752
  });
849
- resp = parseResponse(
850
- respBody,
851
- unmarshalListProvidersRequest_ResponseSchema
852
- );
753
+ resp = parseResponse(respBody, unmarshalListProvidersResponseSchema);
853
754
  };
854
755
  await executeCall(call, options);
855
756
  if (resp === undefined) {
856
- throw new Error('API call completed without a result.');
757
+ throw new Error('operation completed without a result.');
857
758
  }
858
759
  return resp;
859
760
  }
@@ -875,6 +776,46 @@ export class SharingClient {
875
776
  }
876
777
  }
877
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
+
878
819
  /**
879
820
  * Gets an array of all share recipients within the current metastore where:
880
821
  *
@@ -885,7 +826,7 @@ export class SharingClient {
885
826
  async listRecipients(
886
827
  req: ListRecipientsRequest,
887
828
  options?: CallOptions
888
- ): Promise<ListRecipientsRequest_Response> {
829
+ ): Promise<ListRecipientsResponse> {
889
830
  const url = `${this.host}/api/2.1/unity-catalog/recipients`;
890
831
  const params = new URLSearchParams();
891
832
  if (req.dataRecipientGlobalMetastoreId !== undefined) {
@@ -902,8 +843,8 @@ export class SharingClient {
902
843
  }
903
844
  const query = params.toString();
904
845
  const fullUrl = query !== '' ? `${url}?${query}` : url;
905
- let resp: ListRecipientsRequest_Response | undefined;
906
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
846
+ let resp: ListRecipientsResponse | undefined;
847
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
907
848
  const headers = new Headers();
908
849
  if (this.workspaceId !== undefined) {
909
850
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -915,14 +856,11 @@ export class SharingClient {
915
856
  httpClient: this.httpClient,
916
857
  logger: this.logger,
917
858
  });
918
- resp = parseResponse(
919
- respBody,
920
- unmarshalListRecipientsRequest_ResponseSchema
921
- );
859
+ resp = parseResponse(respBody, unmarshalListRecipientsResponseSchema);
922
860
  };
923
861
  await executeCall(call, options);
924
862
  if (resp === undefined) {
925
- throw new Error('API call completed without a result.');
863
+ throw new Error('operation completed without a result.');
926
864
  }
927
865
  return resp;
928
866
  }
@@ -944,6 +882,49 @@ export class SharingClient {
944
882
  }
945
883
  }
946
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
+
947
928
  /**
948
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.
949
930
  * There is no guarantee of a specific ordering of the elements in the array.
@@ -951,7 +932,7 @@ export class SharingClient {
951
932
  async listShares(
952
933
  req: ListSharesRequest,
953
934
  options?: CallOptions
954
- ): Promise<ListSharesRequest_Response> {
935
+ ): Promise<ListSharesResponse> {
955
936
  const url = `${this.host}/api/2.1/unity-catalog/shares`;
956
937
  const params = new URLSearchParams();
957
938
  if (req.maxResults !== undefined) {
@@ -962,8 +943,8 @@ export class SharingClient {
962
943
  }
963
944
  const query = params.toString();
964
945
  const fullUrl = query !== '' ? `${url}?${query}` : url;
965
- let resp: ListSharesRequest_Response | undefined;
966
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
946
+ let resp: ListSharesResponse | undefined;
947
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
967
948
  const headers = new Headers();
968
949
  if (this.workspaceId !== undefined) {
969
950
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -975,11 +956,11 @@ export class SharingClient {
975
956
  httpClient: this.httpClient,
976
957
  logger: this.logger,
977
958
  });
978
- resp = parseResponse(respBody, unmarshalListSharesRequest_ResponseSchema);
959
+ resp = parseResponse(respBody, unmarshalListSharesResponseSchema);
979
960
  };
980
961
  await executeCall(call, options);
981
962
  if (resp === undefined) {
982
- throw new Error('API call completed without a result.');
963
+ throw new Error('operation completed without a result.');
983
964
  }
984
965
  return resp;
985
966
  }
@@ -1008,10 +989,10 @@ export class SharingClient {
1008
989
  async retrieveAccessToken(
1009
990
  req: RetrieveToken,
1010
991
  options?: CallOptions
1011
- ): Promise<RetrieveToken_Response> {
992
+ ): Promise<RetrieveTokenResponse> {
1012
993
  const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation/${req.activationUrl ?? ''}`;
1013
- let resp: RetrieveToken_Response | undefined;
1014
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
994
+ let resp: RetrieveTokenResponse | undefined;
995
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1015
996
  const headers = new Headers();
1016
997
  if (this.workspaceId !== undefined) {
1017
998
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1023,11 +1004,11 @@ export class SharingClient {
1023
1004
  httpClient: this.httpClient,
1024
1005
  logger: this.logger,
1025
1006
  });
1026
- resp = parseResponse(respBody, unmarshalRetrieveToken_ResponseSchema);
1007
+ resp = parseResponse(respBody, unmarshalRetrieveTokenResponseSchema);
1027
1008
  };
1028
1009
  await executeCall(call, options);
1029
1010
  if (resp === undefined) {
1030
- throw new Error('API call completed without a result.');
1011
+ throw new Error('operation completed without a result.');
1031
1012
  }
1032
1013
  return resp;
1033
1014
  }
@@ -1043,7 +1024,7 @@ export class SharingClient {
1043
1024
  const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/rotate-token`;
1044
1025
  const body = marshalRequest(req, marshalRotateRecipientTokenRequestSchema);
1045
1026
  let resp: RecipientInfo | undefined;
1046
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1027
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1047
1028
  const headers = new Headers({'Content-Type': 'application/json'});
1048
1029
  if (this.workspaceId !== undefined) {
1049
1030
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1059,7 +1040,7 @@ export class SharingClient {
1059
1040
  };
1060
1041
  await executeCall(call, options);
1061
1042
  if (resp === undefined) {
1062
- throw new Error('API call completed without a result.');
1043
+ throw new Error('operation completed without a result.');
1063
1044
  }
1064
1045
  return resp;
1065
1046
  }
@@ -1075,7 +1056,7 @@ export class SharingClient {
1075
1056
  const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
1076
1057
  const body = marshalRequest(req, marshalUpdateProviderRequestSchema);
1077
1058
  let resp: ProviderInfo | undefined;
1078
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1059
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1079
1060
  const headers = new Headers({'Content-Type': 'application/json'});
1080
1061
  if (this.workspaceId !== undefined) {
1081
1062
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1091,7 +1072,7 @@ export class SharingClient {
1091
1072
  };
1092
1073
  await executeCall(call, options);
1093
1074
  if (resp === undefined) {
1094
- throw new Error('API call completed without a result.');
1075
+ throw new Error('operation completed without a result.');
1095
1076
  }
1096
1077
  return resp;
1097
1078
  }
@@ -1107,7 +1088,7 @@ export class SharingClient {
1107
1088
  const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.nameArg ?? ''}`;
1108
1089
  const body = marshalRequest(req, marshalUpdateRecipientRequestSchema);
1109
1090
  let resp: RecipientInfo | undefined;
1110
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1091
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1111
1092
  const headers = new Headers({'Content-Type': 'application/json'});
1112
1093
  if (this.workspaceId !== undefined) {
1113
1094
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1123,7 +1104,7 @@ export class SharingClient {
1123
1104
  };
1124
1105
  await executeCall(call, options);
1125
1106
  if (resp === undefined) {
1126
- throw new Error('API call completed without a result.');
1107
+ throw new Error('operation completed without a result.');
1127
1108
  }
1128
1109
  return resp;
1129
1110
  }
@@ -1152,7 +1133,7 @@ export class SharingClient {
1152
1133
  const url = `${this.host}/api/2.1/unity-catalog/shares/${req.nameArg ?? ''}`;
1153
1134
  const body = marshalRequest(req, marshalUpdateShareRequestSchema);
1154
1135
  let resp: ShareInfo | undefined;
1155
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1136
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1156
1137
  const headers = new Headers({'Content-Type': 'application/json'});
1157
1138
  if (this.workspaceId !== undefined) {
1158
1139
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1168,7 +1149,7 @@ export class SharingClient {
1168
1149
  };
1169
1150
  await executeCall(call, options);
1170
1151
  if (resp === undefined) {
1171
- throw new Error('API call completed without a result.');
1152
+ throw new Error('operation completed without a result.');
1172
1153
  }
1173
1154
  return resp;
1174
1155
  }
@@ -1184,14 +1165,14 @@ export class SharingClient {
1184
1165
  async updateSharePermissions(
1185
1166
  req: UpdateSharePermissionsRequest,
1186
1167
  options?: CallOptions
1187
- ): Promise<UpdateSharePermissionsRequest_Response> {
1168
+ ): Promise<UpdateSharePermissionsResponse> {
1188
1169
  const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
1189
1170
  const body = marshalRequest(
1190
1171
  req,
1191
1172
  marshalUpdateSharePermissionsRequestSchema
1192
1173
  );
1193
- let resp: UpdateSharePermissionsRequest_Response | undefined;
1194
- const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
1174
+ let resp: UpdateSharePermissionsResponse | undefined;
1175
+ const call = async (callSignal?: AbortSignal): Promise<void> => {
1195
1176
  const headers = new Headers({'Content-Type': 'application/json'});
1196
1177
  if (this.workspaceId !== undefined) {
1197
1178
  headers.set('X-Databricks-Org-Id', this.workspaceId);
@@ -1205,12 +1186,12 @@ export class SharingClient {
1205
1186
  });
1206
1187
  resp = parseResponse(
1207
1188
  respBody,
1208
- unmarshalUpdateSharePermissionsRequest_ResponseSchema
1189
+ unmarshalUpdateSharePermissionsResponseSchema
1209
1190
  );
1210
1191
  };
1211
1192
  await executeCall(call, options);
1212
1193
  if (resp === undefined) {
1213
- throw new Error('API call completed without a result.');
1194
+ throw new Error('operation completed without a result.');
1214
1195
  }
1215
1196
  return resp;
1216
1197
  }