@databricks/sdk-scim 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +127 -123
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +932 -1229
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -7
- package/dist/v1/index.js +4 -7
- package/dist/v1/model.d.ts +827 -830
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +711 -882
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
package/dist/v1/client.js
CHANGED
|
@@ -1,1232 +1,935 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { resolveClientConfig } from "./transport.js";
|
|
2
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
|
+
import { name, version } from "../package.js";
|
|
4
|
+
import { marshalCreateAccountGroupRequestSchema, marshalCreateAccountServicePrincipalRequestSchema, marshalCreateAccountUserRequestSchema, marshalCreateGroupRequestSchema, marshalCreateServicePrincipalRequestSchema, marshalCreateUserRequestSchema, marshalPasswordPermissionsRequestSchema, marshalPatchAccountGroupRequestSchema, marshalPatchAccountServicePrincipalRequestSchema, marshalPatchAccountUserRequestSchema, marshalPatchGroupRequestSchema, marshalPatchServicePrincipalRequestSchema, marshalPatchUserRequestSchema, marshalUpdateAccountGroupRequestSchema, marshalUpdateAccountServicePrincipalRequestSchema, marshalUpdateAccountUserRequestSchema, marshalUpdateGroupRequestSchema, marshalUpdateServicePrincipalRequestSchema, marshalUpdateUserRequestSchema, unmarshalAccountGroupSchema, unmarshalAccountServicePrincipalSchema, unmarshalAccountUserSchema, unmarshalGetPasswordPermissionLevelsResponseSchema, unmarshalGroupSchema, unmarshalListAccountGroupsResponseSchema, unmarshalListAccountServicePrincipalsResponseSchema, unmarshalListAccountUsersResponseSchema, unmarshalListGroupsResponseSchema, unmarshalListServicePrincipalResponseSchema, unmarshalListUsersResponseSchema, unmarshalPasswordPermissionsSchema, unmarshalServicePrincipalSchema, unmarshalUserSchema } from "./model.js";
|
|
5
|
+
import { VERSION } from "@databricks/sdk-auth";
|
|
6
|
+
import { createDefault } from "@databricks/sdk-core/clientinfo";
|
|
7
|
+
import { NoOpLogger } from "@databricks/sdk-core/logger";
|
|
8
|
+
|
|
9
|
+
//#region src/v1/client.ts
|
|
10
10
|
const PACKAGE_SEGMENT = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
|
|
12
|
+
value: version
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
936
|
-
}
|
|
937
|
-
headers.set('User-Agent', this.userAgent);
|
|
938
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
939
|
-
const respBody = await executeHttpCall({
|
|
940
|
-
request: httpReq,
|
|
941
|
-
httpClient,
|
|
942
|
-
logger: this.logger,
|
|
943
|
-
});
|
|
944
|
-
resp = parseResponse(respBody, unmarshalUserSchema);
|
|
945
|
-
};
|
|
946
|
-
await executeCall(call, options);
|
|
947
|
-
if (resp === undefined) {
|
|
948
|
-
throw new Error('operation completed without a result.');
|
|
949
|
-
}
|
|
950
|
-
return resp;
|
|
951
|
-
}
|
|
952
|
-
/** Deletes a user. Deleting a user from a <Databricks> workspace also removes objects associated with the user. */
|
|
953
|
-
async deleteUser(req, options) {
|
|
954
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
955
|
-
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ''}`;
|
|
956
|
-
const call = async (callSignal) => {
|
|
957
|
-
const headers = new Headers();
|
|
958
|
-
if (workspaceId !== undefined) {
|
|
959
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
960
|
-
}
|
|
961
|
-
headers.set('User-Agent', this.userAgent);
|
|
962
|
-
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
963
|
-
await executeHttpCall({
|
|
964
|
-
request: httpReq,
|
|
965
|
-
httpClient,
|
|
966
|
-
logger: this.logger,
|
|
967
|
-
});
|
|
968
|
-
};
|
|
969
|
-
await executeCall(call, options);
|
|
970
|
-
}
|
|
971
|
-
/** Gets the permission levels that a user can have on an object. */
|
|
972
|
-
async getPermissionLevels(_req, options) {
|
|
973
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
974
|
-
const url = `${host}/api/2.0/permissions/authorization/passwords/permissionLevels`;
|
|
975
|
-
let resp;
|
|
976
|
-
const call = async (callSignal) => {
|
|
977
|
-
const headers = new Headers();
|
|
978
|
-
if (workspaceId !== undefined) {
|
|
979
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
980
|
-
}
|
|
981
|
-
headers.set('User-Agent', this.userAgent);
|
|
982
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
983
|
-
const respBody = await executeHttpCall({
|
|
984
|
-
request: httpReq,
|
|
985
|
-
httpClient,
|
|
986
|
-
logger: this.logger,
|
|
987
|
-
});
|
|
988
|
-
resp = parseResponse(respBody, unmarshalGetPasswordPermissionLevelsResponseSchema);
|
|
989
|
-
};
|
|
990
|
-
await executeCall(call, options);
|
|
991
|
-
if (resp === undefined) {
|
|
992
|
-
throw new Error('operation completed without a result.');
|
|
993
|
-
}
|
|
994
|
-
return resp;
|
|
995
|
-
}
|
|
996
|
-
/** Gets the permissions of all passwords. Passwords can inherit permissions from their root object. */
|
|
997
|
-
async getPermissions(_req, options) {
|
|
998
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
999
|
-
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
1000
|
-
let resp;
|
|
1001
|
-
const call = async (callSignal) => {
|
|
1002
|
-
const headers = new Headers();
|
|
1003
|
-
if (workspaceId !== undefined) {
|
|
1004
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1005
|
-
}
|
|
1006
|
-
headers.set('User-Agent', this.userAgent);
|
|
1007
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1008
|
-
const respBody = await executeHttpCall({
|
|
1009
|
-
request: httpReq,
|
|
1010
|
-
httpClient,
|
|
1011
|
-
logger: this.logger,
|
|
1012
|
-
});
|
|
1013
|
-
resp = parseResponse(respBody, unmarshalPasswordPermissionsSchema);
|
|
1014
|
-
};
|
|
1015
|
-
await executeCall(call, options);
|
|
1016
|
-
if (resp === undefined) {
|
|
1017
|
-
throw new Error('operation completed without a result.');
|
|
1018
|
-
}
|
|
1019
|
-
return resp;
|
|
1020
|
-
}
|
|
1021
|
-
/** Gets information for a specific user in <Databricks> workspace. */
|
|
1022
|
-
async getUser(req, options) {
|
|
1023
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1024
|
-
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ''}`;
|
|
1025
|
-
const params = new URLSearchParams();
|
|
1026
|
-
if (req.attributes !== undefined) {
|
|
1027
|
-
params.append('attributes', req.attributes);
|
|
1028
|
-
}
|
|
1029
|
-
if (req.count !== undefined) {
|
|
1030
|
-
params.append('count', String(req.count));
|
|
1031
|
-
}
|
|
1032
|
-
if (req.excludedAttributes !== undefined) {
|
|
1033
|
-
params.append('excludedAttributes', req.excludedAttributes);
|
|
1034
|
-
}
|
|
1035
|
-
if (req.filter !== undefined) {
|
|
1036
|
-
params.append('filter', req.filter);
|
|
1037
|
-
}
|
|
1038
|
-
if (req.sortBy !== undefined) {
|
|
1039
|
-
params.append('sortBy', req.sortBy);
|
|
1040
|
-
}
|
|
1041
|
-
if (req.sortOrder !== undefined) {
|
|
1042
|
-
params.append('sortOrder', req.sortOrder);
|
|
1043
|
-
}
|
|
1044
|
-
if (req.startIndex !== undefined) {
|
|
1045
|
-
params.append('startIndex', String(req.startIndex));
|
|
1046
|
-
}
|
|
1047
|
-
const query = params.toString();
|
|
1048
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1049
|
-
let resp;
|
|
1050
|
-
const call = async (callSignal) => {
|
|
1051
|
-
const headers = new Headers();
|
|
1052
|
-
if (workspaceId !== undefined) {
|
|
1053
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1054
|
-
}
|
|
1055
|
-
headers.set('User-Agent', this.userAgent);
|
|
1056
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
1057
|
-
const respBody = await executeHttpCall({
|
|
1058
|
-
request: httpReq,
|
|
1059
|
-
httpClient,
|
|
1060
|
-
logger: this.logger,
|
|
1061
|
-
});
|
|
1062
|
-
resp = parseResponse(respBody, unmarshalUserSchema);
|
|
1063
|
-
};
|
|
1064
|
-
await executeCall(call, options);
|
|
1065
|
-
if (resp === undefined) {
|
|
1066
|
-
throw new Error('operation completed without a result.');
|
|
1067
|
-
}
|
|
1068
|
-
return resp;
|
|
1069
|
-
}
|
|
1070
|
-
/** Gets details for all the users associated with a <Databricks> workspace. */
|
|
1071
|
-
async listUsers(req, options) {
|
|
1072
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1073
|
-
const url = `${host}/api/2.0/preview/scim/v2/Users`;
|
|
1074
|
-
const params = new URLSearchParams();
|
|
1075
|
-
if (req.attributes !== undefined) {
|
|
1076
|
-
params.append('attributes', req.attributes);
|
|
1077
|
-
}
|
|
1078
|
-
if (req.count !== undefined) {
|
|
1079
|
-
params.append('count', String(req.count));
|
|
1080
|
-
}
|
|
1081
|
-
if (req.excludedAttributes !== undefined) {
|
|
1082
|
-
params.append('excludedAttributes', req.excludedAttributes);
|
|
1083
|
-
}
|
|
1084
|
-
if (req.filter !== undefined) {
|
|
1085
|
-
params.append('filter', req.filter);
|
|
1086
|
-
}
|
|
1087
|
-
if (req.sortBy !== undefined) {
|
|
1088
|
-
params.append('sortBy', req.sortBy);
|
|
1089
|
-
}
|
|
1090
|
-
if (req.sortOrder !== undefined) {
|
|
1091
|
-
params.append('sortOrder', req.sortOrder);
|
|
1092
|
-
}
|
|
1093
|
-
if (req.startIndex !== undefined) {
|
|
1094
|
-
params.append('startIndex', String(req.startIndex));
|
|
1095
|
-
}
|
|
1096
|
-
const query = params.toString();
|
|
1097
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1098
|
-
let resp;
|
|
1099
|
-
const call = async (callSignal) => {
|
|
1100
|
-
const headers = new Headers();
|
|
1101
|
-
if (workspaceId !== undefined) {
|
|
1102
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1103
|
-
}
|
|
1104
|
-
headers.set('User-Agent', this.userAgent);
|
|
1105
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
1106
|
-
const respBody = await executeHttpCall({
|
|
1107
|
-
request: httpReq,
|
|
1108
|
-
httpClient,
|
|
1109
|
-
logger: this.logger,
|
|
1110
|
-
});
|
|
1111
|
-
resp = parseResponse(respBody, unmarshalListUsersResponseSchema);
|
|
1112
|
-
};
|
|
1113
|
-
await executeCall(call, options);
|
|
1114
|
-
if (resp === undefined) {
|
|
1115
|
-
throw new Error('operation completed without a result.');
|
|
1116
|
-
}
|
|
1117
|
-
return resp;
|
|
1118
|
-
}
|
|
1119
|
-
async *listUsersIter(req, options) {
|
|
1120
|
-
const pageReq = { ...req };
|
|
1121
|
-
for (;;) {
|
|
1122
|
-
const resp = await this.listUsers(pageReq, options);
|
|
1123
|
-
const items = resp.resources ?? [];
|
|
1124
|
-
for (const item of items) {
|
|
1125
|
-
yield item;
|
|
1126
|
-
}
|
|
1127
|
-
if (items.length === 0) {
|
|
1128
|
-
return;
|
|
1129
|
-
}
|
|
1130
|
-
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Partially updates a user resource by applying the supplied operations on specific user attributes.
|
|
1135
|
-
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
1136
|
-
*/
|
|
1137
|
-
async patchUser(req, options) {
|
|
1138
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1139
|
-
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ''}`;
|
|
1140
|
-
const body = marshalRequest(req, marshalPatchUserRequestSchema);
|
|
1141
|
-
const call = async (callSignal) => {
|
|
1142
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1143
|
-
if (workspaceId !== undefined) {
|
|
1144
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1145
|
-
}
|
|
1146
|
-
headers.set('User-Agent', this.userAgent);
|
|
1147
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
1148
|
-
await executeHttpCall({
|
|
1149
|
-
request: httpReq,
|
|
1150
|
-
httpClient,
|
|
1151
|
-
logger: this.logger,
|
|
1152
|
-
});
|
|
1153
|
-
};
|
|
1154
|
-
await executeCall(call, options);
|
|
1155
|
-
}
|
|
1156
|
-
/** Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct permissions if none are specified. Objects can inherit permissions from their root object. */
|
|
1157
|
-
async setPermissions(req, options) {
|
|
1158
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1159
|
-
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
1160
|
-
const body = marshalRequest(req, marshalPasswordPermissionsRequestSchema);
|
|
1161
|
-
let resp;
|
|
1162
|
-
const call = async (callSignal) => {
|
|
1163
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1164
|
-
if (workspaceId !== undefined) {
|
|
1165
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1166
|
-
}
|
|
1167
|
-
headers.set('User-Agent', this.userAgent);
|
|
1168
|
-
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
1169
|
-
const respBody = await executeHttpCall({
|
|
1170
|
-
request: httpReq,
|
|
1171
|
-
httpClient,
|
|
1172
|
-
logger: this.logger,
|
|
1173
|
-
});
|
|
1174
|
-
resp = parseResponse(respBody, unmarshalPasswordPermissionsSchema);
|
|
1175
|
-
};
|
|
1176
|
-
await executeCall(call, options);
|
|
1177
|
-
if (resp === undefined) {
|
|
1178
|
-
throw new Error('operation completed without a result.');
|
|
1179
|
-
}
|
|
1180
|
-
return resp;
|
|
1181
|
-
}
|
|
1182
|
-
/** Updates the permissions on all passwords. Passwords can inherit permissions from their root object. */
|
|
1183
|
-
async updatePermissions(req, options) {
|
|
1184
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1185
|
-
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
1186
|
-
const body = marshalRequest(req, marshalPasswordPermissionsRequestSchema);
|
|
1187
|
-
let resp;
|
|
1188
|
-
const call = async (callSignal) => {
|
|
1189
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1190
|
-
if (workspaceId !== undefined) {
|
|
1191
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1192
|
-
}
|
|
1193
|
-
headers.set('User-Agent', this.userAgent);
|
|
1194
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
1195
|
-
const respBody = await executeHttpCall({
|
|
1196
|
-
request: httpReq,
|
|
1197
|
-
httpClient,
|
|
1198
|
-
logger: this.logger,
|
|
1199
|
-
});
|
|
1200
|
-
resp = parseResponse(respBody, unmarshalPasswordPermissionsSchema);
|
|
1201
|
-
};
|
|
1202
|
-
await executeCall(call, options);
|
|
1203
|
-
if (resp === undefined) {
|
|
1204
|
-
throw new Error('operation completed without a result.');
|
|
1205
|
-
}
|
|
1206
|
-
return resp;
|
|
1207
|
-
}
|
|
1208
|
-
/**
|
|
1209
|
-
* Replaces a user's information with the data supplied in request.
|
|
1210
|
-
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
1211
|
-
*/
|
|
1212
|
-
async updateUser(req, options) {
|
|
1213
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
1214
|
-
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ''}`;
|
|
1215
|
-
const body = marshalRequest(req, marshalUpdateUserRequestSchema);
|
|
1216
|
-
const call = async (callSignal) => {
|
|
1217
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1218
|
-
if (workspaceId !== undefined) {
|
|
1219
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
1220
|
-
}
|
|
1221
|
-
headers.set('User-Agent', this.userAgent);
|
|
1222
|
-
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
1223
|
-
await executeHttpCall({
|
|
1224
|
-
request: httpReq,
|
|
1225
|
-
httpClient,
|
|
1226
|
-
logger: this.logger,
|
|
1227
|
-
});
|
|
1228
|
-
};
|
|
1229
|
-
await executeCall(call, options);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
14
|
+
var ScimClient = class {
|
|
15
|
+
options;
|
|
16
|
+
logger;
|
|
17
|
+
userAgent;
|
|
18
|
+
config;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
22
|
+
this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
|
|
23
|
+
key: "sdk-js-auth",
|
|
24
|
+
value: VERSION
|
|
25
|
+
}).with({
|
|
26
|
+
key: "auth",
|
|
27
|
+
value: options.credentials?.name() ?? "default"
|
|
28
|
+
}).toString();
|
|
29
|
+
}
|
|
30
|
+
resolveConfig() {
|
|
31
|
+
this.config ??= resolveClientConfig(this.options);
|
|
32
|
+
return this.config;
|
|
33
|
+
}
|
|
34
|
+
/** Creates a group in the <Databricks> account with a unique name, using the supplied group details. */
|
|
35
|
+
async createAccountGroup(req, options) {
|
|
36
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
37
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups`;
|
|
38
|
+
const body = marshalRequest(req, marshalCreateAccountGroupRequestSchema);
|
|
39
|
+
let resp;
|
|
40
|
+
const call = async (callSignal) => {
|
|
41
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
42
|
+
headers.set("User-Agent", this.userAgent);
|
|
43
|
+
resp = parseResponse(await executeHttpCall({
|
|
44
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
45
|
+
httpClient,
|
|
46
|
+
logger: this.logger
|
|
47
|
+
}), unmarshalAccountGroupSchema);
|
|
48
|
+
};
|
|
49
|
+
await executeCall(call, options);
|
|
50
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
51
|
+
return resp;
|
|
52
|
+
}
|
|
53
|
+
/** Deletes a group from the <Databricks> account. */
|
|
54
|
+
async deleteAccountGroup(req, options) {
|
|
55
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
56
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups/${req.id ?? ""}`;
|
|
57
|
+
const call = async (callSignal) => {
|
|
58
|
+
const headers = new Headers();
|
|
59
|
+
headers.set("User-Agent", this.userAgent);
|
|
60
|
+
await executeHttpCall({
|
|
61
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
62
|
+
httpClient,
|
|
63
|
+
logger: this.logger
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
await executeCall(call, options);
|
|
67
|
+
}
|
|
68
|
+
/** Gets the information for a specific group in the <Databricks> account. */
|
|
69
|
+
async getAccountGroup(req, options) {
|
|
70
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
71
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups/${req.id ?? ""}`;
|
|
72
|
+
let resp;
|
|
73
|
+
const call = async (callSignal) => {
|
|
74
|
+
const headers = new Headers();
|
|
75
|
+
headers.set("User-Agent", this.userAgent);
|
|
76
|
+
resp = parseResponse(await executeHttpCall({
|
|
77
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
78
|
+
httpClient,
|
|
79
|
+
logger: this.logger
|
|
80
|
+
}), unmarshalAccountGroupSchema);
|
|
81
|
+
};
|
|
82
|
+
await executeCall(call, options);
|
|
83
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
84
|
+
return resp;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets all details of the groups associated with the <Databricks> account. As of 08/22/2025,
|
|
88
|
+
* this endpoint will no longer return members. Instead, members should be retrieved by
|
|
89
|
+
* iterating through `Get group details`. Existing accounts that rely on this attribute
|
|
90
|
+
* will not be impacted and will continue receiving member data as before.
|
|
91
|
+
*/
|
|
92
|
+
async listAccountGroups(req, options) {
|
|
93
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
94
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups`;
|
|
95
|
+
const params = new URLSearchParams();
|
|
96
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
97
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
98
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
99
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
100
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
101
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
102
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
103
|
+
const query = params.toString();
|
|
104
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
105
|
+
let resp;
|
|
106
|
+
const call = async (callSignal) => {
|
|
107
|
+
const headers = new Headers();
|
|
108
|
+
headers.set("User-Agent", this.userAgent);
|
|
109
|
+
resp = parseResponse(await executeHttpCall({
|
|
110
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
111
|
+
httpClient,
|
|
112
|
+
logger: this.logger
|
|
113
|
+
}), unmarshalListAccountGroupsResponseSchema);
|
|
114
|
+
};
|
|
115
|
+
await executeCall(call, options);
|
|
116
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
117
|
+
return resp;
|
|
118
|
+
}
|
|
119
|
+
async *listAccountGroupsIter(req, options) {
|
|
120
|
+
const pageReq = { ...req };
|
|
121
|
+
for (;;) {
|
|
122
|
+
const resp = await this.listAccountGroups(pageReq, options);
|
|
123
|
+
const items = resp.resources ?? [];
|
|
124
|
+
for (const item of items) yield item;
|
|
125
|
+
if (items.length === 0) return;
|
|
126
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Partially updates the details of a group. */
|
|
130
|
+
async patchAccountGroup(req, options) {
|
|
131
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
132
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups/${req.id ?? ""}`;
|
|
133
|
+
const body = marshalRequest(req, marshalPatchAccountGroupRequestSchema);
|
|
134
|
+
const call = async (callSignal) => {
|
|
135
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
136
|
+
headers.set("User-Agent", this.userAgent);
|
|
137
|
+
await executeHttpCall({
|
|
138
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
139
|
+
httpClient,
|
|
140
|
+
logger: this.logger
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
await executeCall(call, options);
|
|
144
|
+
}
|
|
145
|
+
/** Updates the details of a group by replacing the entire group entity. */
|
|
146
|
+
async updateAccountGroup(req, options) {
|
|
147
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
148
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Groups/${req.id ?? ""}`;
|
|
149
|
+
const body = marshalRequest(req, marshalUpdateAccountGroupRequestSchema);
|
|
150
|
+
const call = async (callSignal) => {
|
|
151
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
152
|
+
headers.set("User-Agent", this.userAgent);
|
|
153
|
+
await executeHttpCall({
|
|
154
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
155
|
+
httpClient,
|
|
156
|
+
logger: this.logger
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
await executeCall(call, options);
|
|
160
|
+
}
|
|
161
|
+
/** Creates a new service principal in the <Databricks> account. */
|
|
162
|
+
async createAccountServicePrincipal(req, options) {
|
|
163
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
164
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals`;
|
|
165
|
+
const body = marshalRequest(req, marshalCreateAccountServicePrincipalRequestSchema);
|
|
166
|
+
let resp;
|
|
167
|
+
const call = async (callSignal) => {
|
|
168
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
169
|
+
headers.set("User-Agent", this.userAgent);
|
|
170
|
+
resp = parseResponse(await executeHttpCall({
|
|
171
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
172
|
+
httpClient,
|
|
173
|
+
logger: this.logger
|
|
174
|
+
}), unmarshalAccountServicePrincipalSchema);
|
|
175
|
+
};
|
|
176
|
+
await executeCall(call, options);
|
|
177
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
178
|
+
return resp;
|
|
179
|
+
}
|
|
180
|
+
/** Delete a single service principal in the <Databricks> account. */
|
|
181
|
+
async deleteAccountServicePrincipal(req, options) {
|
|
182
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
183
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
184
|
+
const call = async (callSignal) => {
|
|
185
|
+
const headers = new Headers();
|
|
186
|
+
headers.set("User-Agent", this.userAgent);
|
|
187
|
+
await executeHttpCall({
|
|
188
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
189
|
+
httpClient,
|
|
190
|
+
logger: this.logger
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
await executeCall(call, options);
|
|
194
|
+
}
|
|
195
|
+
/** Gets the details for a single service principal define in the <Databricks> account. */
|
|
196
|
+
async getAccountServicePrincipal(req, options) {
|
|
197
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
198
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
199
|
+
let resp;
|
|
200
|
+
const call = async (callSignal) => {
|
|
201
|
+
const headers = new Headers();
|
|
202
|
+
headers.set("User-Agent", this.userAgent);
|
|
203
|
+
resp = parseResponse(await executeHttpCall({
|
|
204
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
205
|
+
httpClient,
|
|
206
|
+
logger: this.logger
|
|
207
|
+
}), unmarshalAccountServicePrincipalSchema);
|
|
208
|
+
};
|
|
209
|
+
await executeCall(call, options);
|
|
210
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
211
|
+
return resp;
|
|
212
|
+
}
|
|
213
|
+
/** Gets the set of service principals associated with a <Databricks> account. */
|
|
214
|
+
async listAccountServicePrincipals(req, options) {
|
|
215
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
216
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals`;
|
|
217
|
+
const params = new URLSearchParams();
|
|
218
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
219
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
220
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
221
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
222
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
223
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
224
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
225
|
+
const query = params.toString();
|
|
226
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
227
|
+
let resp;
|
|
228
|
+
const call = async (callSignal) => {
|
|
229
|
+
const headers = new Headers();
|
|
230
|
+
headers.set("User-Agent", this.userAgent);
|
|
231
|
+
resp = parseResponse(await executeHttpCall({
|
|
232
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
233
|
+
httpClient,
|
|
234
|
+
logger: this.logger
|
|
235
|
+
}), unmarshalListAccountServicePrincipalsResponseSchema);
|
|
236
|
+
};
|
|
237
|
+
await executeCall(call, options);
|
|
238
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
239
|
+
return resp;
|
|
240
|
+
}
|
|
241
|
+
async *listAccountServicePrincipalsIter(req, options) {
|
|
242
|
+
const pageReq = { ...req };
|
|
243
|
+
for (;;) {
|
|
244
|
+
const resp = await this.listAccountServicePrincipals(pageReq, options);
|
|
245
|
+
const items = resp.resources ?? [];
|
|
246
|
+
for (const item of items) yield item;
|
|
247
|
+
if (items.length === 0) return;
|
|
248
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/** Partially updates the details of a single service principal in the <Databricks> account. */
|
|
252
|
+
async patchAccountServicePrincipal(req, options) {
|
|
253
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
254
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
255
|
+
const body = marshalRequest(req, marshalPatchAccountServicePrincipalRequestSchema);
|
|
256
|
+
const call = async (callSignal) => {
|
|
257
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
258
|
+
headers.set("User-Agent", this.userAgent);
|
|
259
|
+
await executeHttpCall({
|
|
260
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
261
|
+
httpClient,
|
|
262
|
+
logger: this.logger
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
await executeCall(call, options);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Updates the details of a single service principal.
|
|
269
|
+
*
|
|
270
|
+
* This action replaces the existing service principal with the same name.
|
|
271
|
+
*/
|
|
272
|
+
async updateAccountServicePrincipal(req, options) {
|
|
273
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
274
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
275
|
+
const body = marshalRequest(req, marshalUpdateAccountServicePrincipalRequestSchema);
|
|
276
|
+
const call = async (callSignal) => {
|
|
277
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
278
|
+
headers.set("User-Agent", this.userAgent);
|
|
279
|
+
await executeHttpCall({
|
|
280
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
281
|
+
httpClient,
|
|
282
|
+
logger: this.logger
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
await executeCall(call, options);
|
|
286
|
+
}
|
|
287
|
+
/** Creates a new user in the <Databricks> account. This new user will also be added to the <Databricks> account. */
|
|
288
|
+
async createAccountUser(req, options) {
|
|
289
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
290
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users`;
|
|
291
|
+
const body = marshalRequest(req, marshalCreateAccountUserRequestSchema);
|
|
292
|
+
let resp;
|
|
293
|
+
const call = async (callSignal) => {
|
|
294
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
295
|
+
headers.set("User-Agent", this.userAgent);
|
|
296
|
+
resp = parseResponse(await executeHttpCall({
|
|
297
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
298
|
+
httpClient,
|
|
299
|
+
logger: this.logger
|
|
300
|
+
}), unmarshalAccountUserSchema);
|
|
301
|
+
};
|
|
302
|
+
await executeCall(call, options);
|
|
303
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
304
|
+
return resp;
|
|
305
|
+
}
|
|
306
|
+
/** Deletes a user. Deleting a user from a <Databricks> account also removes objects associated with the user. */
|
|
307
|
+
async deleteAccountUser(req, options) {
|
|
308
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
309
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users/${req.id ?? ""}`;
|
|
310
|
+
const call = async (callSignal) => {
|
|
311
|
+
const headers = new Headers();
|
|
312
|
+
headers.set("User-Agent", this.userAgent);
|
|
313
|
+
await executeHttpCall({
|
|
314
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
315
|
+
httpClient,
|
|
316
|
+
logger: this.logger
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
await executeCall(call, options);
|
|
320
|
+
}
|
|
321
|
+
/** Gets information for a specific user in <Databricks> account. */
|
|
322
|
+
async getAccountUser(req, options) {
|
|
323
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
324
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users/${req.id ?? ""}`;
|
|
325
|
+
const params = new URLSearchParams();
|
|
326
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
327
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
328
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
329
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
330
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
331
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
332
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
333
|
+
const query = params.toString();
|
|
334
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
335
|
+
let resp;
|
|
336
|
+
const call = async (callSignal) => {
|
|
337
|
+
const headers = new Headers();
|
|
338
|
+
headers.set("User-Agent", this.userAgent);
|
|
339
|
+
resp = parseResponse(await executeHttpCall({
|
|
340
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
341
|
+
httpClient,
|
|
342
|
+
logger: this.logger
|
|
343
|
+
}), unmarshalAccountUserSchema);
|
|
344
|
+
};
|
|
345
|
+
await executeCall(call, options);
|
|
346
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
347
|
+
return resp;
|
|
348
|
+
}
|
|
349
|
+
/** Gets details for all the users associated with a <Databricks> account. */
|
|
350
|
+
async listAccountUsers(req, options) {
|
|
351
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
352
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users`;
|
|
353
|
+
const params = new URLSearchParams();
|
|
354
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
355
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
356
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
357
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
358
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
359
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
360
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
361
|
+
const query = params.toString();
|
|
362
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
363
|
+
let resp;
|
|
364
|
+
const call = async (callSignal) => {
|
|
365
|
+
const headers = new Headers();
|
|
366
|
+
headers.set("User-Agent", this.userAgent);
|
|
367
|
+
resp = parseResponse(await executeHttpCall({
|
|
368
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
369
|
+
httpClient,
|
|
370
|
+
logger: this.logger
|
|
371
|
+
}), unmarshalListAccountUsersResponseSchema);
|
|
372
|
+
};
|
|
373
|
+
await executeCall(call, options);
|
|
374
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
375
|
+
return resp;
|
|
376
|
+
}
|
|
377
|
+
async *listAccountUsersIter(req, options) {
|
|
378
|
+
const pageReq = { ...req };
|
|
379
|
+
for (;;) {
|
|
380
|
+
const resp = await this.listAccountUsers(pageReq, options);
|
|
381
|
+
const items = resp.resources ?? [];
|
|
382
|
+
for (const item of items) yield item;
|
|
383
|
+
if (items.length === 0) return;
|
|
384
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Partially updates a user resource by applying the supplied operations on specific user attributes.
|
|
389
|
+
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
390
|
+
*/
|
|
391
|
+
async patchAccountUser(req, options) {
|
|
392
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
393
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users/${req.id ?? ""}`;
|
|
394
|
+
const body = marshalRequest(req, marshalPatchAccountUserRequestSchema);
|
|
395
|
+
const call = async (callSignal) => {
|
|
396
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
397
|
+
headers.set("User-Agent", this.userAgent);
|
|
398
|
+
await executeHttpCall({
|
|
399
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
400
|
+
httpClient,
|
|
401
|
+
logger: this.logger
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
await executeCall(call, options);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Replaces a user's information with the data supplied in request.
|
|
408
|
+
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
409
|
+
*/
|
|
410
|
+
async updateAccountUser(req, options) {
|
|
411
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
412
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/scim/v2/Users/${req.id ?? ""}`;
|
|
413
|
+
const body = marshalRequest(req, marshalUpdateAccountUserRequestSchema);
|
|
414
|
+
const call = async (callSignal) => {
|
|
415
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
416
|
+
headers.set("User-Agent", this.userAgent);
|
|
417
|
+
await executeHttpCall({
|
|
418
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
419
|
+
httpClient,
|
|
420
|
+
logger: this.logger
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
await executeCall(call, options);
|
|
424
|
+
}
|
|
425
|
+
/** Get details about the current method caller's identity. */
|
|
426
|
+
async me(req, options) {
|
|
427
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
428
|
+
const url = `${host}/api/2.0/preview/scim/v2/Me`;
|
|
429
|
+
const params = new URLSearchParams();
|
|
430
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
431
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
432
|
+
const query = params.toString();
|
|
433
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
434
|
+
let resp;
|
|
435
|
+
const call = async (callSignal) => {
|
|
436
|
+
const headers = new Headers();
|
|
437
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
438
|
+
headers.set("User-Agent", this.userAgent);
|
|
439
|
+
resp = parseResponse(await executeHttpCall({
|
|
440
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
441
|
+
httpClient,
|
|
442
|
+
logger: this.logger
|
|
443
|
+
}), unmarshalUserSchema);
|
|
444
|
+
};
|
|
445
|
+
await executeCall(call, options);
|
|
446
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
447
|
+
return resp;
|
|
448
|
+
}
|
|
449
|
+
/** Creates a group in the <Databricks> workspace with a unique name, using the supplied group details. */
|
|
450
|
+
async createGroup(req, options) {
|
|
451
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
452
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups`;
|
|
453
|
+
const body = marshalRequest(req, marshalCreateGroupRequestSchema);
|
|
454
|
+
let resp;
|
|
455
|
+
const call = async (callSignal) => {
|
|
456
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
457
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
458
|
+
headers.set("User-Agent", this.userAgent);
|
|
459
|
+
resp = parseResponse(await executeHttpCall({
|
|
460
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
461
|
+
httpClient,
|
|
462
|
+
logger: this.logger
|
|
463
|
+
}), unmarshalGroupSchema);
|
|
464
|
+
};
|
|
465
|
+
await executeCall(call, options);
|
|
466
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
467
|
+
return resp;
|
|
468
|
+
}
|
|
469
|
+
/** Deletes a group from the <Databricks> workspace. */
|
|
470
|
+
async deleteGroup(req, options) {
|
|
471
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
472
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups/${req.id ?? ""}`;
|
|
473
|
+
const call = async (callSignal) => {
|
|
474
|
+
const headers = new Headers();
|
|
475
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
476
|
+
headers.set("User-Agent", this.userAgent);
|
|
477
|
+
await executeHttpCall({
|
|
478
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
479
|
+
httpClient,
|
|
480
|
+
logger: this.logger
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
await executeCall(call, options);
|
|
484
|
+
}
|
|
485
|
+
/** Gets the information for a specific group in the <Databricks> workspace. */
|
|
486
|
+
async getGroup(req, options) {
|
|
487
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
488
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups/${req.id ?? ""}`;
|
|
489
|
+
let resp;
|
|
490
|
+
const call = async (callSignal) => {
|
|
491
|
+
const headers = new Headers();
|
|
492
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
493
|
+
headers.set("User-Agent", this.userAgent);
|
|
494
|
+
resp = parseResponse(await executeHttpCall({
|
|
495
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
496
|
+
httpClient,
|
|
497
|
+
logger: this.logger
|
|
498
|
+
}), unmarshalGroupSchema);
|
|
499
|
+
};
|
|
500
|
+
await executeCall(call, options);
|
|
501
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
502
|
+
return resp;
|
|
503
|
+
}
|
|
504
|
+
/** Gets all details of the groups associated with the <Databricks> workspace. */
|
|
505
|
+
async listGroups(req, options) {
|
|
506
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
507
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups`;
|
|
508
|
+
const params = new URLSearchParams();
|
|
509
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
510
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
511
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
512
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
513
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
514
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
515
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
516
|
+
const query = params.toString();
|
|
517
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
518
|
+
let resp;
|
|
519
|
+
const call = async (callSignal) => {
|
|
520
|
+
const headers = new Headers();
|
|
521
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
522
|
+
headers.set("User-Agent", this.userAgent);
|
|
523
|
+
resp = parseResponse(await executeHttpCall({
|
|
524
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
525
|
+
httpClient,
|
|
526
|
+
logger: this.logger
|
|
527
|
+
}), unmarshalListGroupsResponseSchema);
|
|
528
|
+
};
|
|
529
|
+
await executeCall(call, options);
|
|
530
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
531
|
+
return resp;
|
|
532
|
+
}
|
|
533
|
+
async *listGroupsIter(req, options) {
|
|
534
|
+
const pageReq = { ...req };
|
|
535
|
+
for (;;) {
|
|
536
|
+
const resp = await this.listGroups(pageReq, options);
|
|
537
|
+
const items = resp.resources ?? [];
|
|
538
|
+
for (const item of items) yield item;
|
|
539
|
+
if (items.length === 0) return;
|
|
540
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/** Partially updates the details of a group. */
|
|
544
|
+
async patchGroup(req, options) {
|
|
545
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
546
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups/${req.id ?? ""}`;
|
|
547
|
+
const body = marshalRequest(req, marshalPatchGroupRequestSchema);
|
|
548
|
+
const call = async (callSignal) => {
|
|
549
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
550
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
551
|
+
headers.set("User-Agent", this.userAgent);
|
|
552
|
+
await executeHttpCall({
|
|
553
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
554
|
+
httpClient,
|
|
555
|
+
logger: this.logger
|
|
556
|
+
});
|
|
557
|
+
};
|
|
558
|
+
await executeCall(call, options);
|
|
559
|
+
}
|
|
560
|
+
/** Updates the details of a group by replacing the entire group entity. */
|
|
561
|
+
async updateGroup(req, options) {
|
|
562
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
563
|
+
const url = `${host}/api/2.0/preview/scim/v2/Groups/${req.id ?? ""}`;
|
|
564
|
+
const body = marshalRequest(req, marshalUpdateGroupRequestSchema);
|
|
565
|
+
const call = async (callSignal) => {
|
|
566
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
567
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
568
|
+
headers.set("User-Agent", this.userAgent);
|
|
569
|
+
await executeHttpCall({
|
|
570
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
571
|
+
httpClient,
|
|
572
|
+
logger: this.logger
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
await executeCall(call, options);
|
|
576
|
+
}
|
|
577
|
+
/** Creates a new service principal in the <Databricks> workspace. */
|
|
578
|
+
async createServicePrincipal(req, options) {
|
|
579
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
580
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals`;
|
|
581
|
+
const body = marshalRequest(req, marshalCreateServicePrincipalRequestSchema);
|
|
582
|
+
let resp;
|
|
583
|
+
const call = async (callSignal) => {
|
|
584
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
585
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
586
|
+
headers.set("User-Agent", this.userAgent);
|
|
587
|
+
resp = parseResponse(await executeHttpCall({
|
|
588
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
589
|
+
httpClient,
|
|
590
|
+
logger: this.logger
|
|
591
|
+
}), unmarshalServicePrincipalSchema);
|
|
592
|
+
};
|
|
593
|
+
await executeCall(call, options);
|
|
594
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
595
|
+
return resp;
|
|
596
|
+
}
|
|
597
|
+
/** Delete a single service principal in the <Databricks> workspace. */
|
|
598
|
+
async deleteServicePrincipal(req, options) {
|
|
599
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
600
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
601
|
+
const call = async (callSignal) => {
|
|
602
|
+
const headers = new Headers();
|
|
603
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
604
|
+
headers.set("User-Agent", this.userAgent);
|
|
605
|
+
await executeHttpCall({
|
|
606
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
607
|
+
httpClient,
|
|
608
|
+
logger: this.logger
|
|
609
|
+
});
|
|
610
|
+
};
|
|
611
|
+
await executeCall(call, options);
|
|
612
|
+
}
|
|
613
|
+
/** Gets the details for a single service principal define in the <Databricks> workspace. */
|
|
614
|
+
async getServicePrincipal(req, options) {
|
|
615
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
616
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
617
|
+
let resp;
|
|
618
|
+
const call = async (callSignal) => {
|
|
619
|
+
const headers = new Headers();
|
|
620
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
621
|
+
headers.set("User-Agent", this.userAgent);
|
|
622
|
+
resp = parseResponse(await executeHttpCall({
|
|
623
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
624
|
+
httpClient,
|
|
625
|
+
logger: this.logger
|
|
626
|
+
}), unmarshalServicePrincipalSchema);
|
|
627
|
+
};
|
|
628
|
+
await executeCall(call, options);
|
|
629
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
630
|
+
return resp;
|
|
631
|
+
}
|
|
632
|
+
/** Gets the set of service principals associated with a <Databricks> workspace. */
|
|
633
|
+
async listServicePrincipals(req, options) {
|
|
634
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
635
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals`;
|
|
636
|
+
const params = new URLSearchParams();
|
|
637
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
638
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
639
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
640
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
641
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
642
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
643
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
644
|
+
const query = params.toString();
|
|
645
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
646
|
+
let resp;
|
|
647
|
+
const call = async (callSignal) => {
|
|
648
|
+
const headers = new Headers();
|
|
649
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
650
|
+
headers.set("User-Agent", this.userAgent);
|
|
651
|
+
resp = parseResponse(await executeHttpCall({
|
|
652
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
653
|
+
httpClient,
|
|
654
|
+
logger: this.logger
|
|
655
|
+
}), unmarshalListServicePrincipalResponseSchema);
|
|
656
|
+
};
|
|
657
|
+
await executeCall(call, options);
|
|
658
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
659
|
+
return resp;
|
|
660
|
+
}
|
|
661
|
+
async *listServicePrincipalsIter(req, options) {
|
|
662
|
+
const pageReq = { ...req };
|
|
663
|
+
for (;;) {
|
|
664
|
+
const resp = await this.listServicePrincipals(pageReq, options);
|
|
665
|
+
const items = resp.resources ?? [];
|
|
666
|
+
for (const item of items) yield item;
|
|
667
|
+
if (items.length === 0) return;
|
|
668
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
/** Partially updates the details of a single service principal in the <Databricks> workspace. */
|
|
672
|
+
async patchServicePrincipal(req, options) {
|
|
673
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
674
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
675
|
+
const body = marshalRequest(req, marshalPatchServicePrincipalRequestSchema);
|
|
676
|
+
const call = async (callSignal) => {
|
|
677
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
678
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
679
|
+
headers.set("User-Agent", this.userAgent);
|
|
680
|
+
await executeHttpCall({
|
|
681
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
682
|
+
httpClient,
|
|
683
|
+
logger: this.logger
|
|
684
|
+
});
|
|
685
|
+
};
|
|
686
|
+
await executeCall(call, options);
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Updates the details of a single service principal.
|
|
690
|
+
*
|
|
691
|
+
* This action replaces the existing service principal with the same name.
|
|
692
|
+
*/
|
|
693
|
+
async updateServicePrincipal(req, options) {
|
|
694
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
695
|
+
const url = `${host}/api/2.0/preview/scim/v2/ServicePrincipals/${req.id ?? ""}`;
|
|
696
|
+
const body = marshalRequest(req, marshalUpdateServicePrincipalRequestSchema);
|
|
697
|
+
const call = async (callSignal) => {
|
|
698
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
699
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
700
|
+
headers.set("User-Agent", this.userAgent);
|
|
701
|
+
await executeHttpCall({
|
|
702
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
703
|
+
httpClient,
|
|
704
|
+
logger: this.logger
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
await executeCall(call, options);
|
|
708
|
+
}
|
|
709
|
+
/** Creates a new user in the <Databricks> workspace. This new user will also be added to the <Databricks> account. */
|
|
710
|
+
async createUser(req, options) {
|
|
711
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
712
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users`;
|
|
713
|
+
const body = marshalRequest(req, marshalCreateUserRequestSchema);
|
|
714
|
+
let resp;
|
|
715
|
+
const call = async (callSignal) => {
|
|
716
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
717
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
718
|
+
headers.set("User-Agent", this.userAgent);
|
|
719
|
+
resp = parseResponse(await executeHttpCall({
|
|
720
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
721
|
+
httpClient,
|
|
722
|
+
logger: this.logger
|
|
723
|
+
}), unmarshalUserSchema);
|
|
724
|
+
};
|
|
725
|
+
await executeCall(call, options);
|
|
726
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
727
|
+
return resp;
|
|
728
|
+
}
|
|
729
|
+
/** Deletes a user. Deleting a user from a <Databricks> workspace also removes objects associated with the user. */
|
|
730
|
+
async deleteUser(req, options) {
|
|
731
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
732
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ""}`;
|
|
733
|
+
const call = async (callSignal) => {
|
|
734
|
+
const headers = new Headers();
|
|
735
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
736
|
+
headers.set("User-Agent", this.userAgent);
|
|
737
|
+
await executeHttpCall({
|
|
738
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
739
|
+
httpClient,
|
|
740
|
+
logger: this.logger
|
|
741
|
+
});
|
|
742
|
+
};
|
|
743
|
+
await executeCall(call, options);
|
|
744
|
+
}
|
|
745
|
+
/** Gets the permission levels that a user can have on an object. */
|
|
746
|
+
async getPermissionLevels(_req, options) {
|
|
747
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
748
|
+
const url = `${host}/api/2.0/permissions/authorization/passwords/permissionLevels`;
|
|
749
|
+
let resp;
|
|
750
|
+
const call = async (callSignal) => {
|
|
751
|
+
const headers = new Headers();
|
|
752
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
753
|
+
headers.set("User-Agent", this.userAgent);
|
|
754
|
+
resp = parseResponse(await executeHttpCall({
|
|
755
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
756
|
+
httpClient,
|
|
757
|
+
logger: this.logger
|
|
758
|
+
}), unmarshalGetPasswordPermissionLevelsResponseSchema);
|
|
759
|
+
};
|
|
760
|
+
await executeCall(call, options);
|
|
761
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
762
|
+
return resp;
|
|
763
|
+
}
|
|
764
|
+
/** Gets the permissions of all passwords. Passwords can inherit permissions from their root object. */
|
|
765
|
+
async getPermissions(_req, options) {
|
|
766
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
767
|
+
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
768
|
+
let resp;
|
|
769
|
+
const call = async (callSignal) => {
|
|
770
|
+
const headers = new Headers();
|
|
771
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
772
|
+
headers.set("User-Agent", this.userAgent);
|
|
773
|
+
resp = parseResponse(await executeHttpCall({
|
|
774
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
775
|
+
httpClient,
|
|
776
|
+
logger: this.logger
|
|
777
|
+
}), unmarshalPasswordPermissionsSchema);
|
|
778
|
+
};
|
|
779
|
+
await executeCall(call, options);
|
|
780
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
781
|
+
return resp;
|
|
782
|
+
}
|
|
783
|
+
/** Gets information for a specific user in <Databricks> workspace. */
|
|
784
|
+
async getUser(req, options) {
|
|
785
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
786
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ""}`;
|
|
787
|
+
const params = new URLSearchParams();
|
|
788
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
789
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
790
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
791
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
792
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
793
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
794
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
795
|
+
const query = params.toString();
|
|
796
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
797
|
+
let resp;
|
|
798
|
+
const call = async (callSignal) => {
|
|
799
|
+
const headers = new Headers();
|
|
800
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
801
|
+
headers.set("User-Agent", this.userAgent);
|
|
802
|
+
resp = parseResponse(await executeHttpCall({
|
|
803
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
804
|
+
httpClient,
|
|
805
|
+
logger: this.logger
|
|
806
|
+
}), unmarshalUserSchema);
|
|
807
|
+
};
|
|
808
|
+
await executeCall(call, options);
|
|
809
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
810
|
+
return resp;
|
|
811
|
+
}
|
|
812
|
+
/** Gets details for all the users associated with a <Databricks> workspace. */
|
|
813
|
+
async listUsers(req, options) {
|
|
814
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
815
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users`;
|
|
816
|
+
const params = new URLSearchParams();
|
|
817
|
+
if (req.attributes !== void 0) params.append("attributes", req.attributes);
|
|
818
|
+
if (req.count !== void 0) params.append("count", String(req.count));
|
|
819
|
+
if (req.excludedAttributes !== void 0) params.append("excludedAttributes", req.excludedAttributes);
|
|
820
|
+
if (req.filter !== void 0) params.append("filter", req.filter);
|
|
821
|
+
if (req.sortBy !== void 0) params.append("sortBy", req.sortBy);
|
|
822
|
+
if (req.sortOrder !== void 0) params.append("sortOrder", req.sortOrder);
|
|
823
|
+
if (req.startIndex !== void 0) params.append("startIndex", String(req.startIndex));
|
|
824
|
+
const query = params.toString();
|
|
825
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
826
|
+
let resp;
|
|
827
|
+
const call = async (callSignal) => {
|
|
828
|
+
const headers = new Headers();
|
|
829
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
830
|
+
headers.set("User-Agent", this.userAgent);
|
|
831
|
+
resp = parseResponse(await executeHttpCall({
|
|
832
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
833
|
+
httpClient,
|
|
834
|
+
logger: this.logger
|
|
835
|
+
}), unmarshalListUsersResponseSchema);
|
|
836
|
+
};
|
|
837
|
+
await executeCall(call, options);
|
|
838
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
839
|
+
return resp;
|
|
840
|
+
}
|
|
841
|
+
async *listUsersIter(req, options) {
|
|
842
|
+
const pageReq = { ...req };
|
|
843
|
+
for (;;) {
|
|
844
|
+
const resp = await this.listUsers(pageReq, options);
|
|
845
|
+
const items = resp.resources ?? [];
|
|
846
|
+
for (const item of items) yield item;
|
|
847
|
+
if (items.length === 0) return;
|
|
848
|
+
pageReq.startIndex = (resp.startIndex ?? 0n) + BigInt(items.length);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Partially updates a user resource by applying the supplied operations on specific user attributes.
|
|
853
|
+
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
854
|
+
*/
|
|
855
|
+
async patchUser(req, options) {
|
|
856
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
857
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ""}`;
|
|
858
|
+
const body = marshalRequest(req, marshalPatchUserRequestSchema);
|
|
859
|
+
const call = async (callSignal) => {
|
|
860
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
861
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
862
|
+
headers.set("User-Agent", this.userAgent);
|
|
863
|
+
await executeHttpCall({
|
|
864
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
865
|
+
httpClient,
|
|
866
|
+
logger: this.logger
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
await executeCall(call, options);
|
|
870
|
+
}
|
|
871
|
+
/** Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct permissions if none are specified. Objects can inherit permissions from their root object. */
|
|
872
|
+
async setPermissions(req, options) {
|
|
873
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
874
|
+
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
875
|
+
const body = marshalRequest(req, marshalPasswordPermissionsRequestSchema);
|
|
876
|
+
let resp;
|
|
877
|
+
const call = async (callSignal) => {
|
|
878
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
879
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
880
|
+
headers.set("User-Agent", this.userAgent);
|
|
881
|
+
resp = parseResponse(await executeHttpCall({
|
|
882
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
883
|
+
httpClient,
|
|
884
|
+
logger: this.logger
|
|
885
|
+
}), unmarshalPasswordPermissionsSchema);
|
|
886
|
+
};
|
|
887
|
+
await executeCall(call, options);
|
|
888
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
889
|
+
return resp;
|
|
890
|
+
}
|
|
891
|
+
/** Updates the permissions on all passwords. Passwords can inherit permissions from their root object. */
|
|
892
|
+
async updatePermissions(req, options) {
|
|
893
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
894
|
+
const url = `${host}/api/2.0/permissions/authorization/passwords`;
|
|
895
|
+
const body = marshalRequest(req, marshalPasswordPermissionsRequestSchema);
|
|
896
|
+
let resp;
|
|
897
|
+
const call = async (callSignal) => {
|
|
898
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
899
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
900
|
+
headers.set("User-Agent", this.userAgent);
|
|
901
|
+
resp = parseResponse(await executeHttpCall({
|
|
902
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
903
|
+
httpClient,
|
|
904
|
+
logger: this.logger
|
|
905
|
+
}), unmarshalPasswordPermissionsSchema);
|
|
906
|
+
};
|
|
907
|
+
await executeCall(call, options);
|
|
908
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
909
|
+
return resp;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Replaces a user's information with the data supplied in request.
|
|
913
|
+
* The `userName` and `emails` attributes cannot be updated through this API; any supplied changes to them are ignored (no-op).
|
|
914
|
+
*/
|
|
915
|
+
async updateUser(req, options) {
|
|
916
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
917
|
+
const url = `${host}/api/2.0/preview/scim/v2/Users/${req.id ?? ""}`;
|
|
918
|
+
const body = marshalRequest(req, marshalUpdateUserRequestSchema);
|
|
919
|
+
const call = async (callSignal) => {
|
|
920
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
921
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
922
|
+
headers.set("User-Agent", this.userAgent);
|
|
923
|
+
await executeHttpCall({
|
|
924
|
+
request: buildHttpRequest("PUT", url, headers, callSignal, body),
|
|
925
|
+
httpClient,
|
|
926
|
+
logger: this.logger
|
|
927
|
+
});
|
|
928
|
+
};
|
|
929
|
+
await executeCall(call, options);
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
//#endregion
|
|
934
|
+
export { ScimClient };
|
|
1232
935
|
//# sourceMappingURL=client.js.map
|