basaltic-sdk-python 0.1.1__py3-none-any.whl

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.
Files changed (47) hide show
  1. basaltic/__init__.py +26 -0
  2. basaltic/_client.py +136 -0
  3. basaltic/_common.py +284 -0
  4. basaltic/_transport.py +196 -0
  5. basaltic/_version.py +3 -0
  6. basaltic/auth.py +231 -0
  7. basaltic/client.py +144 -0
  8. basaltic/config.py +151 -0
  9. basaltic/errors.py +73 -0
  10. basaltic/models/__init__.py +17 -0
  11. basaltic/models/audit.py +85 -0
  12. basaltic/models/billing.py +284 -0
  13. basaltic/models/catalog.py +35 -0
  14. basaltic/models/certificate.py +127 -0
  15. basaltic/models/compute.py +905 -0
  16. basaltic/models/dns.py +256 -0
  17. basaltic/models/iam.py +736 -0
  18. basaltic/models/kms.py +157 -0
  19. basaltic/models/loadbalancer.py +574 -0
  20. basaltic/models/network.py +985 -0
  21. basaltic/models/quota.py +30 -0
  22. basaltic/models/secrets.py +136 -0
  23. basaltic/models/storage.py +789 -0
  24. basaltic/models/telemetry.py +393 -0
  25. basaltic/models/workspace.py +734 -0
  26. basaltic/py.typed +0 -0
  27. basaltic/response.py +152 -0
  28. basaltic/services/__init__.py +1 -0
  29. basaltic/services/audit.py +211 -0
  30. basaltic/services/billing.py +777 -0
  31. basaltic/services/catalog.py +172 -0
  32. basaltic/services/certificate.py +395 -0
  33. basaltic/services/compute.py +2395 -0
  34. basaltic/services/dns.py +1079 -0
  35. basaltic/services/iam.py +3405 -0
  36. basaltic/services/kms.py +742 -0
  37. basaltic/services/loadbalancer.py +1727 -0
  38. basaltic/services/network.py +4691 -0
  39. basaltic/services/quota.py +75 -0
  40. basaltic/services/secrets.py +550 -0
  41. basaltic/services/storage.py +3059 -0
  42. basaltic/services/telemetry.py +1316 -0
  43. basaltic/services/workspace.py +3899 -0
  44. basaltic_sdk_python-0.1.1.dist-info/METADATA +211 -0
  45. basaltic_sdk_python-0.1.1.dist-info/RECORD +47 -0
  46. basaltic_sdk_python-0.1.1.dist-info/WHEEL +4 -0
  47. basaltic_sdk_python-0.1.1.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,3899 @@
1
+ """Generated typed API methods; do not edit."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import AsyncIterator, Iterator
6
+ from typing import cast
7
+
8
+ from .._common import UNSET, Operation
9
+ from .._transport import AsyncTransport, SyncTransport
10
+ from ..config import RequestOptions
11
+ from ..models import workspace as m
12
+ from ..response import (
13
+ ApiResponse,
14
+ Page,
15
+ aiterate_pages,
16
+ aresolve_reference,
17
+ iterate_pages,
18
+ reference_scope,
19
+ resolve_reference,
20
+ )
21
+
22
+ _OPS = {
23
+ "addUser": Operation(
24
+ id="addUser",
25
+ method="POST",
26
+ path="/v1/users",
27
+ authenticated=True,
28
+ requiredQuery=[],
29
+ requiredHeaders=[],
30
+ queryEncoding={},
31
+ bodyRequired=True,
32
+ contentType="application/json",
33
+ accept="application/json",
34
+ ),
35
+ "addUserToGroup": Operation(
36
+ id="addUserToGroup",
37
+ method="POST",
38
+ path="/v1/users/{user_id}/groups",
39
+ authenticated=True,
40
+ requiredQuery=[],
41
+ requiredHeaders=[],
42
+ queryEncoding={},
43
+ bodyRequired=True,
44
+ contentType="application/json",
45
+ accept="application/json",
46
+ ),
47
+ "assignAccountRole": Operation(
48
+ id="assignAccountRole",
49
+ method="POST",
50
+ path="/v1/accounts/{account_id}/role-assignments",
51
+ authenticated=True,
52
+ requiredQuery=[],
53
+ requiredHeaders=[],
54
+ queryEncoding={},
55
+ bodyRequired=True,
56
+ contentType="application/json",
57
+ accept="application/json",
58
+ ),
59
+ "attachGroupPolicy": Operation(
60
+ id="attachGroupPolicy",
61
+ method="POST",
62
+ path="/v1/groups/{group_id}/policies",
63
+ authenticated=True,
64
+ requiredQuery=[],
65
+ requiredHeaders=[],
66
+ queryEncoding={},
67
+ bodyRequired=True,
68
+ contentType="application/json",
69
+ accept="application/json",
70
+ ),
71
+ "attachRolePolicy": Operation(
72
+ id="attachRolePolicy",
73
+ method="POST",
74
+ path="/v1/roles/{role_id}/policies",
75
+ authenticated=True,
76
+ requiredQuery=[],
77
+ requiredHeaders=[],
78
+ queryEncoding={},
79
+ bodyRequired=True,
80
+ contentType="application/json",
81
+ accept="application/json",
82
+ ),
83
+ "attachServiceAccountPolicy": Operation(
84
+ id="attachServiceAccountPolicy",
85
+ method="POST",
86
+ path="/v1/service-accounts/{service_account_id}/policies",
87
+ authenticated=True,
88
+ requiredQuery=[],
89
+ requiredHeaders=[],
90
+ queryEncoding={},
91
+ bodyRequired=True,
92
+ contentType="application/json",
93
+ accept="application/json",
94
+ ),
95
+ "attachUserPolicy": Operation(
96
+ id="attachUserPolicy",
97
+ method="POST",
98
+ path="/v1/users/{user_id}/policies",
99
+ authenticated=True,
100
+ requiredQuery=[],
101
+ requiredHeaders=[],
102
+ queryEncoding={},
103
+ bodyRequired=True,
104
+ contentType="application/json",
105
+ accept="application/json",
106
+ ),
107
+ "cancelInvitation": Operation(
108
+ id="cancelInvitation",
109
+ method="DELETE",
110
+ path="/v1/invitations/{invitation_id}",
111
+ authenticated=True,
112
+ requiredQuery=[],
113
+ requiredHeaders=[],
114
+ queryEncoding={},
115
+ bodyRequired=False,
116
+ contentType="",
117
+ accept="application/json",
118
+ ),
119
+ "createAccount": Operation(
120
+ id="createAccount",
121
+ method="POST",
122
+ path="/v1/accounts",
123
+ authenticated=True,
124
+ requiredQuery=[],
125
+ requiredHeaders=[],
126
+ queryEncoding={},
127
+ bodyRequired=True,
128
+ contentType="application/json",
129
+ accept="application/json",
130
+ ),
131
+ "createGroup": Operation(
132
+ id="createGroup",
133
+ method="POST",
134
+ path="/v1/groups",
135
+ authenticated=True,
136
+ requiredQuery=[],
137
+ requiredHeaders=[],
138
+ queryEncoding={},
139
+ bodyRequired=True,
140
+ contentType="application/json",
141
+ accept="application/json",
142
+ ),
143
+ "createPolicy": Operation(
144
+ id="createPolicy",
145
+ method="POST",
146
+ path="/v1/policies",
147
+ authenticated=True,
148
+ requiredQuery=[],
149
+ requiredHeaders=[],
150
+ queryEncoding={},
151
+ bodyRequired=True,
152
+ contentType="application/json",
153
+ accept="application/json",
154
+ ),
155
+ "deleteAccount": Operation(
156
+ id="deleteAccount",
157
+ method="DELETE",
158
+ path="/v1/accounts/{account_id}",
159
+ authenticated=True,
160
+ requiredQuery=[],
161
+ requiredHeaders=[],
162
+ queryEncoding={},
163
+ bodyRequired=False,
164
+ contentType="",
165
+ accept="application/json",
166
+ ),
167
+ "deleteGroup": Operation(
168
+ id="deleteGroup",
169
+ method="DELETE",
170
+ path="/v1/groups/{group_id}",
171
+ authenticated=True,
172
+ requiredQuery=[],
173
+ requiredHeaders=[],
174
+ queryEncoding={},
175
+ bodyRequired=False,
176
+ contentType="",
177
+ accept="application/json",
178
+ ),
179
+ "deleteGroupInlinePolicy": Operation(
180
+ id="deleteGroupInlinePolicy",
181
+ method="DELETE",
182
+ path="/v1/groups/{group_id}/inline-policies/{policy_name}",
183
+ authenticated=True,
184
+ requiredQuery=[],
185
+ requiredHeaders=[],
186
+ queryEncoding={},
187
+ bodyRequired=False,
188
+ contentType="",
189
+ accept="application/json",
190
+ ),
191
+ "deleteOrganization": Operation(
192
+ id="deleteOrganization",
193
+ method="DELETE",
194
+ path="/v1/organizations/{organization_id}",
195
+ authenticated=True,
196
+ requiredQuery=[],
197
+ requiredHeaders=[],
198
+ queryEncoding={},
199
+ bodyRequired=False,
200
+ contentType="",
201
+ accept="application/json",
202
+ ),
203
+ "deletePolicy": Operation(
204
+ id="deletePolicy",
205
+ method="DELETE",
206
+ path="/v1/policies/{policy_id}",
207
+ authenticated=True,
208
+ requiredQuery=[],
209
+ requiredHeaders=[],
210
+ queryEncoding={},
211
+ bodyRequired=False,
212
+ contentType="",
213
+ accept="application/json",
214
+ ),
215
+ "deleteUserInlinePolicy": Operation(
216
+ id="deleteUserInlinePolicy",
217
+ method="DELETE",
218
+ path="/v1/users/{user_id}/inline-policies/{policy_name}",
219
+ authenticated=True,
220
+ requiredQuery=[],
221
+ requiredHeaders=[],
222
+ queryEncoding={},
223
+ bodyRequired=False,
224
+ contentType="",
225
+ accept="application/json",
226
+ ),
227
+ "detachGroupPolicy": Operation(
228
+ id="detachGroupPolicy",
229
+ method="DELETE",
230
+ path="/v1/groups/{group_id}/policies/{policy_id}",
231
+ authenticated=True,
232
+ requiredQuery=[],
233
+ requiredHeaders=[],
234
+ queryEncoding={},
235
+ bodyRequired=False,
236
+ contentType="",
237
+ accept="application/json",
238
+ ),
239
+ "detachRolePolicy": Operation(
240
+ id="detachRolePolicy",
241
+ method="DELETE",
242
+ path="/v1/roles/{role_id}/policies/{policy_id}",
243
+ authenticated=True,
244
+ requiredQuery=[],
245
+ requiredHeaders=[],
246
+ queryEncoding={},
247
+ bodyRequired=False,
248
+ contentType="",
249
+ accept="application/json",
250
+ ),
251
+ "detachServiceAccountPolicy": Operation(
252
+ id="detachServiceAccountPolicy",
253
+ method="DELETE",
254
+ path="/v1/service-accounts/{service_account_id}/policies/{policy_id}",
255
+ authenticated=True,
256
+ requiredQuery=[],
257
+ requiredHeaders=[],
258
+ queryEncoding={},
259
+ bodyRequired=False,
260
+ contentType="",
261
+ accept="application/json",
262
+ ),
263
+ "detachUserPolicy": Operation(
264
+ id="detachUserPolicy",
265
+ method="DELETE",
266
+ path="/v1/users/{user_id}/policies/{policy_id}",
267
+ authenticated=True,
268
+ requiredQuery=[],
269
+ requiredHeaders=[],
270
+ queryEncoding={},
271
+ bodyRequired=False,
272
+ contentType="",
273
+ accept="application/json",
274
+ ),
275
+ "getAccount": Operation(
276
+ id="getAccount",
277
+ method="GET",
278
+ path="/v1/accounts/{account_id}",
279
+ authenticated=True,
280
+ requiredQuery=[],
281
+ requiredHeaders=[],
282
+ queryEncoding={},
283
+ bodyRequired=False,
284
+ contentType="",
285
+ accept="application/json",
286
+ ),
287
+ "getAccountResources": Operation(
288
+ id="getAccountResources",
289
+ method="GET",
290
+ path="/v1/accounts/{account_id}/resources",
291
+ authenticated=True,
292
+ requiredQuery=[],
293
+ requiredHeaders=[],
294
+ queryEncoding={},
295
+ bodyRequired=False,
296
+ contentType="",
297
+ accept="application/json",
298
+ ),
299
+ "getGroup": Operation(
300
+ id="getGroup",
301
+ method="GET",
302
+ path="/v1/groups/{group_id}",
303
+ authenticated=True,
304
+ requiredQuery=[],
305
+ requiredHeaders=[],
306
+ queryEncoding={},
307
+ bodyRequired=False,
308
+ contentType="",
309
+ accept="application/json",
310
+ ),
311
+ "getGroupInlinePolicy": Operation(
312
+ id="getGroupInlinePolicy",
313
+ method="GET",
314
+ path="/v1/groups/{group_id}/inline-policies/{policy_name}",
315
+ authenticated=True,
316
+ requiredQuery=[],
317
+ requiredHeaders=[],
318
+ queryEncoding={},
319
+ bodyRequired=False,
320
+ contentType="",
321
+ accept="application/json",
322
+ ),
323
+ "getInvitation": Operation(
324
+ id="getInvitation",
325
+ method="GET",
326
+ path="/v1/invitations/{invitation_id}",
327
+ authenticated=True,
328
+ requiredQuery=[],
329
+ requiredHeaders=[],
330
+ queryEncoding={},
331
+ bodyRequired=False,
332
+ contentType="",
333
+ accept="application/json",
334
+ ),
335
+ "getOrganization": Operation(
336
+ id="getOrganization",
337
+ method="GET",
338
+ path="/v1/organizations/{organization_id}",
339
+ authenticated=True,
340
+ requiredQuery=[],
341
+ requiredHeaders=[],
342
+ queryEncoding={},
343
+ bodyRequired=False,
344
+ contentType="",
345
+ accept="application/json",
346
+ ),
347
+ "getPolicy": Operation(
348
+ id="getPolicy",
349
+ method="GET",
350
+ path="/v1/policies/{policy_id}",
351
+ authenticated=True,
352
+ requiredQuery=[],
353
+ requiredHeaders=[],
354
+ queryEncoding={},
355
+ bodyRequired=False,
356
+ contentType="",
357
+ accept="application/json",
358
+ ),
359
+ "getUser": Operation(
360
+ id="getUser",
361
+ method="GET",
362
+ path="/v1/users/{user_id}",
363
+ authenticated=True,
364
+ requiredQuery=[],
365
+ requiredHeaders=[],
366
+ queryEncoding={},
367
+ bodyRequired=False,
368
+ contentType="",
369
+ accept="application/json",
370
+ ),
371
+ "getUserInlinePolicy": Operation(
372
+ id="getUserInlinePolicy",
373
+ method="GET",
374
+ path="/v1/users/{user_id}/inline-policies/{policy_name}",
375
+ authenticated=True,
376
+ requiredQuery=[],
377
+ requiredHeaders=[],
378
+ queryEncoding={},
379
+ bodyRequired=False,
380
+ contentType="",
381
+ accept="application/json",
382
+ ),
383
+ "getUserPermissionBoundary": Operation(
384
+ id="getUserPermissionBoundary",
385
+ method="GET",
386
+ path="/v1/users/{user_id}/permission-boundary",
387
+ authenticated=True,
388
+ requiredQuery=[],
389
+ requiredHeaders=[],
390
+ queryEncoding={},
391
+ bodyRequired=False,
392
+ contentType="",
393
+ accept="application/json",
394
+ ),
395
+ "listAccountRoleAssignments": Operation(
396
+ id="listAccountRoleAssignments",
397
+ method="GET",
398
+ path="/v1/accounts/{account_id}/role-assignments",
399
+ authenticated=True,
400
+ requiredQuery=[],
401
+ requiredHeaders=[],
402
+ queryEncoding={},
403
+ bodyRequired=False,
404
+ contentType="",
405
+ accept="application/json",
406
+ itemsKey="role_assignments",
407
+ ),
408
+ "listAccountRoles": Operation(
409
+ id="listAccountRoles",
410
+ method="GET",
411
+ path="/v1/account-roles",
412
+ authenticated=True,
413
+ requiredQuery=[],
414
+ requiredHeaders=[],
415
+ queryEncoding={},
416
+ bodyRequired=False,
417
+ contentType="",
418
+ accept="application/json",
419
+ itemsKey="account_roles",
420
+ ),
421
+ "listAccounts": Operation(
422
+ id="listAccounts",
423
+ method="GET",
424
+ path="/v1/accounts",
425
+ authenticated=True,
426
+ requiredQuery=[],
427
+ requiredHeaders=[],
428
+ queryEncoding={
429
+ "name": {"style": "form", "explode": True},
430
+ "crn": {"style": "form", "explode": True},
431
+ "limit": {"style": "form", "explode": True},
432
+ "marker": {"style": "form", "explode": True},
433
+ },
434
+ bodyRequired=False,
435
+ contentType="",
436
+ accept="application/json",
437
+ itemsKey="accounts",
438
+ ),
439
+ "listGroupInlinePolicies": Operation(
440
+ id="listGroupInlinePolicies",
441
+ method="GET",
442
+ path="/v1/groups/{group_id}/inline-policies",
443
+ authenticated=True,
444
+ requiredQuery=[],
445
+ requiredHeaders=[],
446
+ queryEncoding={
447
+ "name": {"style": "form", "explode": True},
448
+ "crn": {"style": "form", "explode": True},
449
+ },
450
+ bodyRequired=False,
451
+ contentType="",
452
+ accept="application/json",
453
+ itemsKey="inline_policies",
454
+ ),
455
+ "listGroupPolicies": Operation(
456
+ id="listGroupPolicies",
457
+ method="GET",
458
+ path="/v1/groups/{group_id}/policies",
459
+ authenticated=True,
460
+ requiredQuery=[],
461
+ requiredHeaders=[],
462
+ queryEncoding={
463
+ "name": {"style": "form", "explode": True},
464
+ "crn": {"style": "form", "explode": True},
465
+ },
466
+ bodyRequired=False,
467
+ contentType="",
468
+ accept="application/json",
469
+ itemsKey="policies",
470
+ ),
471
+ "listGroupUsers": Operation(
472
+ id="listGroupUsers",
473
+ method="GET",
474
+ path="/v1/groups/{group_id}/users",
475
+ authenticated=True,
476
+ requiredQuery=[],
477
+ requiredHeaders=[],
478
+ queryEncoding={
479
+ "name": {"style": "form", "explode": True},
480
+ "crn": {"style": "form", "explode": True},
481
+ "limit": {"style": "form", "explode": True},
482
+ "marker": {"style": "form", "explode": True},
483
+ },
484
+ bodyRequired=False,
485
+ contentType="",
486
+ accept="application/json",
487
+ itemsKey="users",
488
+ ),
489
+ "listGroups": Operation(
490
+ id="listGroups",
491
+ method="GET",
492
+ path="/v1/groups",
493
+ authenticated=True,
494
+ requiredQuery=[],
495
+ requiredHeaders=[],
496
+ queryEncoding={
497
+ "name": {"style": "form", "explode": True},
498
+ "crn": {"style": "form", "explode": True},
499
+ "limit": {"style": "form", "explode": True},
500
+ "marker": {"style": "form", "explode": True},
501
+ },
502
+ bodyRequired=False,
503
+ contentType="",
504
+ accept="application/json",
505
+ itemsKey="groups",
506
+ ),
507
+ "listInvitations": Operation(
508
+ id="listInvitations",
509
+ method="GET",
510
+ path="/v1/invitations",
511
+ authenticated=True,
512
+ requiredQuery=[],
513
+ requiredHeaders=[],
514
+ queryEncoding={
515
+ "name": {"style": "form", "explode": True},
516
+ "crn": {"style": "form", "explode": True},
517
+ "limit": {"style": "form", "explode": True},
518
+ "marker": {"style": "form", "explode": True},
519
+ },
520
+ bodyRequired=False,
521
+ contentType="",
522
+ accept="application/json",
523
+ itemsKey="invitations",
524
+ ),
525
+ "listOrganizations": Operation(
526
+ id="listOrganizations",
527
+ method="GET",
528
+ path="/v1/organizations",
529
+ authenticated=True,
530
+ requiredQuery=[],
531
+ requiredHeaders=[],
532
+ queryEncoding={
533
+ "name": {"style": "form", "explode": True},
534
+ "crn": {"style": "form", "explode": True},
535
+ "limit": {"style": "form", "explode": True},
536
+ "marker": {"style": "form", "explode": True},
537
+ },
538
+ bodyRequired=False,
539
+ contentType="",
540
+ accept="application/json",
541
+ itemsKey="organizations",
542
+ ),
543
+ "listPolicies": Operation(
544
+ id="listPolicies",
545
+ method="GET",
546
+ path="/v1/policies",
547
+ authenticated=True,
548
+ requiredQuery=[],
549
+ requiredHeaders=[],
550
+ queryEncoding={
551
+ "name": {"style": "form", "explode": True},
552
+ "crn": {"style": "form", "explode": True},
553
+ "limit": {"style": "form", "explode": True},
554
+ "marker": {"style": "form", "explode": True},
555
+ },
556
+ bodyRequired=False,
557
+ contentType="",
558
+ accept="application/json",
559
+ itemsKey="policies",
560
+ ),
561
+ "listPolicyGroups": Operation(
562
+ id="listPolicyGroups",
563
+ method="GET",
564
+ path="/v1/policies/{policy_id}/groups",
565
+ authenticated=True,
566
+ requiredQuery=[],
567
+ requiredHeaders=[],
568
+ queryEncoding={
569
+ "name": {"style": "form", "explode": True},
570
+ "crn": {"style": "form", "explode": True},
571
+ "limit": {"style": "form", "explode": True},
572
+ "marker": {"style": "form", "explode": True},
573
+ },
574
+ bodyRequired=False,
575
+ contentType="",
576
+ accept="application/json",
577
+ itemsKey="groups",
578
+ ),
579
+ "listPolicyRoles": Operation(
580
+ id="listPolicyRoles",
581
+ method="GET",
582
+ path="/v1/policies/{policy_id}/roles",
583
+ authenticated=True,
584
+ requiredQuery=[],
585
+ requiredHeaders=[],
586
+ queryEncoding={
587
+ "name": {"style": "form", "explode": True},
588
+ "crn": {"style": "form", "explode": True},
589
+ "limit": {"style": "form", "explode": True},
590
+ "marker": {"style": "form", "explode": True},
591
+ },
592
+ bodyRequired=False,
593
+ contentType="",
594
+ accept="application/json",
595
+ itemsKey="roles",
596
+ ),
597
+ "listPolicyServiceAccounts": Operation(
598
+ id="listPolicyServiceAccounts",
599
+ method="GET",
600
+ path="/v1/policies/{policy_id}/service-accounts",
601
+ authenticated=True,
602
+ requiredQuery=[],
603
+ requiredHeaders=[],
604
+ queryEncoding={
605
+ "name": {"style": "form", "explode": True},
606
+ "crn": {"style": "form", "explode": True},
607
+ "limit": {"style": "form", "explode": True},
608
+ "marker": {"style": "form", "explode": True},
609
+ },
610
+ bodyRequired=False,
611
+ contentType="",
612
+ accept="application/json",
613
+ itemsKey="service_accounts",
614
+ ),
615
+ "listPolicyUsers": Operation(
616
+ id="listPolicyUsers",
617
+ method="GET",
618
+ path="/v1/policies/{policy_id}/users",
619
+ authenticated=True,
620
+ requiredQuery=[],
621
+ requiredHeaders=[],
622
+ queryEncoding={
623
+ "name": {"style": "form", "explode": True},
624
+ "crn": {"style": "form", "explode": True},
625
+ "limit": {"style": "form", "explode": True},
626
+ "marker": {"style": "form", "explode": True},
627
+ },
628
+ bodyRequired=False,
629
+ contentType="",
630
+ accept="application/json",
631
+ itemsKey="users",
632
+ ),
633
+ "listRolePolicies": Operation(
634
+ id="listRolePolicies",
635
+ method="GET",
636
+ path="/v1/roles/{role_id}/policies",
637
+ authenticated=True,
638
+ requiredQuery=[],
639
+ requiredHeaders=[],
640
+ queryEncoding={
641
+ "name": {"style": "form", "explode": True},
642
+ "crn": {"style": "form", "explode": True},
643
+ },
644
+ bodyRequired=False,
645
+ contentType="",
646
+ accept="application/json",
647
+ itemsKey="policies",
648
+ ),
649
+ "listServiceAccountPolicies": Operation(
650
+ id="listServiceAccountPolicies",
651
+ method="GET",
652
+ path="/v1/service-accounts/{service_account_id}/policies",
653
+ authenticated=True,
654
+ requiredQuery=[],
655
+ requiredHeaders=[],
656
+ queryEncoding={
657
+ "name": {"style": "form", "explode": True},
658
+ "crn": {"style": "form", "explode": True},
659
+ },
660
+ bodyRequired=False,
661
+ contentType="",
662
+ accept="application/json",
663
+ itemsKey="policies",
664
+ ),
665
+ "listUserGroups": Operation(
666
+ id="listUserGroups",
667
+ method="GET",
668
+ path="/v1/users/{user_id}/groups",
669
+ authenticated=True,
670
+ requiredQuery=[],
671
+ requiredHeaders=[],
672
+ queryEncoding={
673
+ "name": {"style": "form", "explode": True},
674
+ "crn": {"style": "form", "explode": True},
675
+ },
676
+ bodyRequired=False,
677
+ contentType="",
678
+ accept="application/json",
679
+ itemsKey="groups",
680
+ ),
681
+ "listUserInlinePolicies": Operation(
682
+ id="listUserInlinePolicies",
683
+ method="GET",
684
+ path="/v1/users/{user_id}/inline-policies",
685
+ authenticated=True,
686
+ requiredQuery=[],
687
+ requiredHeaders=[],
688
+ queryEncoding={
689
+ "name": {"style": "form", "explode": True},
690
+ "crn": {"style": "form", "explode": True},
691
+ },
692
+ bodyRequired=False,
693
+ contentType="",
694
+ accept="application/json",
695
+ itemsKey="inline_policies",
696
+ ),
697
+ "listUserPolicies": Operation(
698
+ id="listUserPolicies",
699
+ method="GET",
700
+ path="/v1/users/{user_id}/policies",
701
+ authenticated=True,
702
+ requiredQuery=[],
703
+ requiredHeaders=[],
704
+ queryEncoding={
705
+ "name": {"style": "form", "explode": True},
706
+ "crn": {"style": "form", "explode": True},
707
+ },
708
+ bodyRequired=False,
709
+ contentType="",
710
+ accept="application/json",
711
+ itemsKey="policies",
712
+ ),
713
+ "listUsers": Operation(
714
+ id="listUsers",
715
+ method="GET",
716
+ path="/v1/users",
717
+ authenticated=True,
718
+ requiredQuery=[],
719
+ requiredHeaders=[],
720
+ queryEncoding={
721
+ "name": {"style": "form", "explode": True},
722
+ "crn": {"style": "form", "explode": True},
723
+ "limit": {"style": "form", "explode": True},
724
+ "marker": {"style": "form", "explode": True},
725
+ },
726
+ bodyRequired=False,
727
+ contentType="",
728
+ accept="application/json",
729
+ itemsKey="users",
730
+ ),
731
+ "putGroupInlinePolicy": Operation(
732
+ id="putGroupInlinePolicy",
733
+ method="PUT",
734
+ path="/v1/groups/{group_id}/inline-policies/{policy_name}",
735
+ authenticated=True,
736
+ requiredQuery=[],
737
+ requiredHeaders=[],
738
+ queryEncoding={},
739
+ bodyRequired=True,
740
+ contentType="application/json",
741
+ accept="application/json",
742
+ ),
743
+ "putUserInlinePolicy": Operation(
744
+ id="putUserInlinePolicy",
745
+ method="PUT",
746
+ path="/v1/users/{user_id}/inline-policies/{policy_name}",
747
+ authenticated=True,
748
+ requiredQuery=[],
749
+ requiredHeaders=[],
750
+ queryEncoding={},
751
+ bodyRequired=True,
752
+ contentType="application/json",
753
+ accept="application/json",
754
+ ),
755
+ "removeAccountRoleAssignment": Operation(
756
+ id="removeAccountRoleAssignment",
757
+ method="DELETE",
758
+ path="/v1/accounts/{account_id}/role-assignments/{assignment_id}",
759
+ authenticated=True,
760
+ requiredQuery=[],
761
+ requiredHeaders=[],
762
+ queryEncoding={},
763
+ bodyRequired=False,
764
+ contentType="",
765
+ accept="application/json",
766
+ ),
767
+ "removeUser": Operation(
768
+ id="removeUser",
769
+ method="DELETE",
770
+ path="/v1/users/{user_id}",
771
+ authenticated=True,
772
+ requiredQuery=[],
773
+ requiredHeaders=[],
774
+ queryEncoding={},
775
+ bodyRequired=False,
776
+ contentType="",
777
+ accept="application/json",
778
+ ),
779
+ "removeUserFromGroup": Operation(
780
+ id="removeUserFromGroup",
781
+ method="DELETE",
782
+ path="/v1/users/{user_id}/groups/{group_id}",
783
+ authenticated=True,
784
+ requiredQuery=[],
785
+ requiredHeaders=[],
786
+ queryEncoding={},
787
+ bodyRequired=False,
788
+ contentType="",
789
+ accept="application/json",
790
+ ),
791
+ "removeUserPermissionBoundary": Operation(
792
+ id="removeUserPermissionBoundary",
793
+ method="DELETE",
794
+ path="/v1/users/{user_id}/permission-boundary",
795
+ authenticated=True,
796
+ requiredQuery=[],
797
+ requiredHeaders=[],
798
+ queryEncoding={},
799
+ bodyRequired=False,
800
+ contentType="",
801
+ accept="application/json",
802
+ ),
803
+ "setUserPermissionBoundary": Operation(
804
+ id="setUserPermissionBoundary",
805
+ method="PUT",
806
+ path="/v1/users/{user_id}/permission-boundary",
807
+ authenticated=True,
808
+ requiredQuery=[],
809
+ requiredHeaders=[],
810
+ queryEncoding={},
811
+ bodyRequired=True,
812
+ contentType="application/json",
813
+ accept="application/json",
814
+ ),
815
+ "updateAccount": Operation(
816
+ id="updateAccount",
817
+ method="PATCH",
818
+ path="/v1/accounts/{account_id}",
819
+ authenticated=True,
820
+ requiredQuery=[],
821
+ requiredHeaders=[],
822
+ queryEncoding={},
823
+ bodyRequired=True,
824
+ contentType="application/json",
825
+ accept="application/json",
826
+ ),
827
+ "updateGroup": Operation(
828
+ id="updateGroup",
829
+ method="PATCH",
830
+ path="/v1/groups/{group_id}",
831
+ authenticated=True,
832
+ requiredQuery=[],
833
+ requiredHeaders=[],
834
+ queryEncoding={},
835
+ bodyRequired=True,
836
+ contentType="application/json",
837
+ accept="application/json",
838
+ ),
839
+ "updateOrganization": Operation(
840
+ id="updateOrganization",
841
+ method="PATCH",
842
+ path="/v1/organizations/{organization_id}",
843
+ authenticated=True,
844
+ requiredQuery=[],
845
+ requiredHeaders=[],
846
+ queryEncoding={},
847
+ bodyRequired=True,
848
+ contentType="application/json",
849
+ accept="application/json",
850
+ ),
851
+ "updatePolicy": Operation(
852
+ id="updatePolicy",
853
+ method="PATCH",
854
+ path="/v1/policies/{policy_id}",
855
+ authenticated=True,
856
+ requiredQuery=[],
857
+ requiredHeaders=[],
858
+ queryEncoding={},
859
+ bodyRequired=True,
860
+ contentType="application/json",
861
+ accept="application/json",
862
+ ),
863
+ }
864
+
865
+
866
+ class WorkspaceService:
867
+ def __init__(self, transport: SyncTransport) -> None:
868
+ self._transport = transport
869
+
870
+ def add_user(
871
+ self, body: m.AddUserBody, *, options: RequestOptions | None = None
872
+ ) -> ApiResponse[m.AddUserResponse]:
873
+ "Add user to organization"
874
+ return cast(
875
+ ApiResponse[m.AddUserResponse],
876
+ self._transport.request(
877
+ "workspace",
878
+ "https://workspace.basaltic.sh",
879
+ _OPS["addUser"],
880
+ "json",
881
+ {},
882
+ body,
883
+ None,
884
+ options,
885
+ ),
886
+ )
887
+
888
+ def add_user_to_group(
889
+ self, user_id: str, body: m.AddUserToGroupBody, *, options: RequestOptions | None = None
890
+ ) -> None:
891
+ "Add user to group"
892
+ return cast(
893
+ None,
894
+ self._transport.request(
895
+ "workspace",
896
+ "https://workspace.basaltic.sh",
897
+ _OPS["addUserToGroup"],
898
+ "discard",
899
+ {"user_id": user_id},
900
+ body,
901
+ None,
902
+ options,
903
+ ),
904
+ )
905
+
906
+ def assign_account_role(
907
+ self,
908
+ account_id: str,
909
+ body: m.AssignAccountRoleBody,
910
+ *,
911
+ options: RequestOptions | None = None,
912
+ ) -> ApiResponse[m.AssignAccountRoleResponse]:
913
+ "Assign account role"
914
+ return cast(
915
+ ApiResponse[m.AssignAccountRoleResponse],
916
+ self._transport.request(
917
+ "workspace",
918
+ "https://workspace.basaltic.sh",
919
+ _OPS["assignAccountRole"],
920
+ "json",
921
+ {"account_id": account_id},
922
+ body,
923
+ None,
924
+ options,
925
+ ),
926
+ )
927
+
928
+ def attach_group_policy(
929
+ self, group_id: str, body: m.AttachGroupPolicyBody, *, options: RequestOptions | None = None
930
+ ) -> None:
931
+ "Attach policy to group"
932
+ return cast(
933
+ None,
934
+ self._transport.request(
935
+ "workspace",
936
+ "https://workspace.basaltic.sh",
937
+ _OPS["attachGroupPolicy"],
938
+ "discard",
939
+ {"group_id": group_id},
940
+ body,
941
+ None,
942
+ options,
943
+ ),
944
+ )
945
+
946
+ def attach_role_policy(
947
+ self, role_id: str, body: m.AttachRolePolicyBody, *, options: RequestOptions | None = None
948
+ ) -> None:
949
+ "Attach policy to role"
950
+ return cast(
951
+ None,
952
+ self._transport.request(
953
+ "workspace",
954
+ "https://workspace.basaltic.sh",
955
+ _OPS["attachRolePolicy"],
956
+ "discard",
957
+ {"role_id": role_id},
958
+ body,
959
+ None,
960
+ options,
961
+ ),
962
+ )
963
+
964
+ def attach_service_account_policy(
965
+ self,
966
+ service_account_id: str,
967
+ body: m.AttachServiceAccountPolicyBody,
968
+ *,
969
+ options: RequestOptions | None = None,
970
+ ) -> None:
971
+ "Attach policy to service account"
972
+ return cast(
973
+ None,
974
+ self._transport.request(
975
+ "workspace",
976
+ "https://workspace.basaltic.sh",
977
+ _OPS["attachServiceAccountPolicy"],
978
+ "discard",
979
+ {"service_account_id": service_account_id},
980
+ body,
981
+ None,
982
+ options,
983
+ ),
984
+ )
985
+
986
+ def attach_user_policy(
987
+ self, user_id: str, body: m.AttachUserPolicyBody, *, options: RequestOptions | None = None
988
+ ) -> None:
989
+ "Attach policy to user"
990
+ return cast(
991
+ None,
992
+ self._transport.request(
993
+ "workspace",
994
+ "https://workspace.basaltic.sh",
995
+ _OPS["attachUserPolicy"],
996
+ "discard",
997
+ {"user_id": user_id},
998
+ body,
999
+ None,
1000
+ options,
1001
+ ),
1002
+ )
1003
+
1004
+ def cancel_invitation(
1005
+ self, invitation_id: str, *, options: RequestOptions | None = None
1006
+ ) -> None:
1007
+ "Cancel invitation"
1008
+ return cast(
1009
+ None,
1010
+ self._transport.request(
1011
+ "workspace",
1012
+ "https://workspace.basaltic.sh",
1013
+ _OPS["cancelInvitation"],
1014
+ "discard",
1015
+ {"invitation_id": invitation_id},
1016
+ UNSET,
1017
+ None,
1018
+ options,
1019
+ ),
1020
+ )
1021
+
1022
+ def create_account(
1023
+ self, body: m.CreateAccountBody, *, options: RequestOptions | None = None
1024
+ ) -> ApiResponse[m.CreateAccountResponse]:
1025
+ "Create account"
1026
+ return cast(
1027
+ ApiResponse[m.CreateAccountResponse],
1028
+ self._transport.request(
1029
+ "workspace",
1030
+ "https://workspace.basaltic.sh",
1031
+ _OPS["createAccount"],
1032
+ "json",
1033
+ {},
1034
+ body,
1035
+ None,
1036
+ options,
1037
+ ),
1038
+ )
1039
+
1040
+ def create_group(
1041
+ self, body: m.CreateGroupBody, *, options: RequestOptions | None = None
1042
+ ) -> ApiResponse[m.CreateGroupResponse]:
1043
+ "Create group"
1044
+ return cast(
1045
+ ApiResponse[m.CreateGroupResponse],
1046
+ self._transport.request(
1047
+ "workspace",
1048
+ "https://workspace.basaltic.sh",
1049
+ _OPS["createGroup"],
1050
+ "json",
1051
+ {},
1052
+ body,
1053
+ None,
1054
+ options,
1055
+ ),
1056
+ )
1057
+
1058
+ def create_policy(
1059
+ self, body: m.CreatePolicyBody, *, options: RequestOptions | None = None
1060
+ ) -> ApiResponse[m.CreatePolicyResponse]:
1061
+ "Create policy"
1062
+ return cast(
1063
+ ApiResponse[m.CreatePolicyResponse],
1064
+ self._transport.request(
1065
+ "workspace",
1066
+ "https://workspace.basaltic.sh",
1067
+ _OPS["createPolicy"],
1068
+ "json",
1069
+ {},
1070
+ body,
1071
+ None,
1072
+ options,
1073
+ ),
1074
+ )
1075
+
1076
+ def delete_account(self, account_id: str, *, options: RequestOptions | None = None) -> None:
1077
+ "Delete account"
1078
+ return cast(
1079
+ None,
1080
+ self._transport.request(
1081
+ "workspace",
1082
+ "https://workspace.basaltic.sh",
1083
+ _OPS["deleteAccount"],
1084
+ "discard",
1085
+ {"account_id": account_id},
1086
+ UNSET,
1087
+ None,
1088
+ options,
1089
+ ),
1090
+ )
1091
+
1092
+ def delete_group(self, group_id: str, *, options: RequestOptions | None = None) -> None:
1093
+ "Delete group"
1094
+ return cast(
1095
+ None,
1096
+ self._transport.request(
1097
+ "workspace",
1098
+ "https://workspace.basaltic.sh",
1099
+ _OPS["deleteGroup"],
1100
+ "discard",
1101
+ {"group_id": group_id},
1102
+ UNSET,
1103
+ None,
1104
+ options,
1105
+ ),
1106
+ )
1107
+
1108
+ def delete_group_inline_policy(
1109
+ self, group_id: str, policy_name: str, *, options: RequestOptions | None = None
1110
+ ) -> None:
1111
+ "Delete a group's inline policy by name"
1112
+ return cast(
1113
+ None,
1114
+ self._transport.request(
1115
+ "workspace",
1116
+ "https://workspace.basaltic.sh",
1117
+ _OPS["deleteGroupInlinePolicy"],
1118
+ "discard",
1119
+ {"group_id": group_id, "policy_name": policy_name},
1120
+ UNSET,
1121
+ None,
1122
+ options,
1123
+ ),
1124
+ )
1125
+
1126
+ def delete_organization(
1127
+ self, organization_id: str, *, options: RequestOptions | None = None
1128
+ ) -> None:
1129
+ "Delete organization"
1130
+ return cast(
1131
+ None,
1132
+ self._transport.request(
1133
+ "workspace",
1134
+ "https://workspace.basaltic.sh",
1135
+ _OPS["deleteOrganization"],
1136
+ "discard",
1137
+ {"organization_id": organization_id},
1138
+ UNSET,
1139
+ None,
1140
+ options,
1141
+ ),
1142
+ )
1143
+
1144
+ def delete_policy(self, policy_id: str, *, options: RequestOptions | None = None) -> None:
1145
+ "Delete policy"
1146
+ return cast(
1147
+ None,
1148
+ self._transport.request(
1149
+ "workspace",
1150
+ "https://workspace.basaltic.sh",
1151
+ _OPS["deletePolicy"],
1152
+ "discard",
1153
+ {"policy_id": policy_id},
1154
+ UNSET,
1155
+ None,
1156
+ options,
1157
+ ),
1158
+ )
1159
+
1160
+ def delete_user_inline_policy(
1161
+ self, user_id: str, policy_name: str, *, options: RequestOptions | None = None
1162
+ ) -> None:
1163
+ "Delete a user's inline policy by name"
1164
+ return cast(
1165
+ None,
1166
+ self._transport.request(
1167
+ "workspace",
1168
+ "https://workspace.basaltic.sh",
1169
+ _OPS["deleteUserInlinePolicy"],
1170
+ "discard",
1171
+ {"user_id": user_id, "policy_name": policy_name},
1172
+ UNSET,
1173
+ None,
1174
+ options,
1175
+ ),
1176
+ )
1177
+
1178
+ def detach_group_policy(
1179
+ self, group_id: str, policy_id: str, *, options: RequestOptions | None = None
1180
+ ) -> None:
1181
+ "Detach policy from group"
1182
+ return cast(
1183
+ None,
1184
+ self._transport.request(
1185
+ "workspace",
1186
+ "https://workspace.basaltic.sh",
1187
+ _OPS["detachGroupPolicy"],
1188
+ "discard",
1189
+ {"group_id": group_id, "policy_id": policy_id},
1190
+ UNSET,
1191
+ None,
1192
+ options,
1193
+ ),
1194
+ )
1195
+
1196
+ def detach_role_policy(
1197
+ self, role_id: str, policy_id: str, *, options: RequestOptions | None = None
1198
+ ) -> None:
1199
+ "Detach policy from role"
1200
+ return cast(
1201
+ None,
1202
+ self._transport.request(
1203
+ "workspace",
1204
+ "https://workspace.basaltic.sh",
1205
+ _OPS["detachRolePolicy"],
1206
+ "discard",
1207
+ {"role_id": role_id, "policy_id": policy_id},
1208
+ UNSET,
1209
+ None,
1210
+ options,
1211
+ ),
1212
+ )
1213
+
1214
+ def detach_service_account_policy(
1215
+ self, service_account_id: str, policy_id: str, *, options: RequestOptions | None = None
1216
+ ) -> None:
1217
+ "Detach policy from service account"
1218
+ return cast(
1219
+ None,
1220
+ self._transport.request(
1221
+ "workspace",
1222
+ "https://workspace.basaltic.sh",
1223
+ _OPS["detachServiceAccountPolicy"],
1224
+ "discard",
1225
+ {"service_account_id": service_account_id, "policy_id": policy_id},
1226
+ UNSET,
1227
+ None,
1228
+ options,
1229
+ ),
1230
+ )
1231
+
1232
+ def detach_user_policy(
1233
+ self, user_id: str, policy_id: str, *, options: RequestOptions | None = None
1234
+ ) -> None:
1235
+ "Detach policy from user"
1236
+ return cast(
1237
+ None,
1238
+ self._transport.request(
1239
+ "workspace",
1240
+ "https://workspace.basaltic.sh",
1241
+ _OPS["detachUserPolicy"],
1242
+ "discard",
1243
+ {"user_id": user_id, "policy_id": policy_id},
1244
+ UNSET,
1245
+ None,
1246
+ options,
1247
+ ),
1248
+ )
1249
+
1250
+ def get_account(
1251
+ self, account_id: str, *, options: RequestOptions | None = None
1252
+ ) -> ApiResponse[m.GetAccountResponse]:
1253
+ "Get account"
1254
+ return cast(
1255
+ ApiResponse[m.GetAccountResponse],
1256
+ self._transport.request(
1257
+ "workspace",
1258
+ "https://workspace.basaltic.sh",
1259
+ _OPS["getAccount"],
1260
+ "json",
1261
+ {"account_id": account_id},
1262
+ UNSET,
1263
+ None,
1264
+ options,
1265
+ ),
1266
+ )
1267
+
1268
+ def get_account_by_reference(
1269
+ self,
1270
+ reference: str,
1271
+ *,
1272
+ scope: m.GetAccountScope | None = None,
1273
+ options: RequestOptions | None = None,
1274
+ ) -> ApiResponse[m.GetAccountResource]:
1275
+ return cast(
1276
+ ApiResponse[m.GetAccountResource],
1277
+ resolve_reference(
1278
+ reference,
1279
+ lambda id: self.get_account(id, options=options),
1280
+ lambda match: self.list_accounts(
1281
+ query=cast(
1282
+ m.ListAccountsQuery, {**reference_scope(scope), **match, "limit": 2}
1283
+ ),
1284
+ options=options,
1285
+ ),
1286
+ True,
1287
+ "account",
1288
+ ),
1289
+ )
1290
+
1291
+ def get_account_resources(
1292
+ self, account_id: str, *, options: RequestOptions | None = None
1293
+ ) -> ApiResponse[m.GetAccountResourcesResponse]:
1294
+ "Check account resource presence"
1295
+ return cast(
1296
+ ApiResponse[m.GetAccountResourcesResponse],
1297
+ self._transport.request(
1298
+ "workspace",
1299
+ "https://workspace.basaltic.sh",
1300
+ _OPS["getAccountResources"],
1301
+ "json",
1302
+ {"account_id": account_id},
1303
+ UNSET,
1304
+ None,
1305
+ options,
1306
+ ),
1307
+ )
1308
+
1309
+ def get_group(
1310
+ self, group_id: str, *, options: RequestOptions | None = None
1311
+ ) -> ApiResponse[m.GetGroupResponse]:
1312
+ "Get group"
1313
+ return cast(
1314
+ ApiResponse[m.GetGroupResponse],
1315
+ self._transport.request(
1316
+ "workspace",
1317
+ "https://workspace.basaltic.sh",
1318
+ _OPS["getGroup"],
1319
+ "json",
1320
+ {"group_id": group_id},
1321
+ UNSET,
1322
+ None,
1323
+ options,
1324
+ ),
1325
+ )
1326
+
1327
+ def get_group_by_reference(
1328
+ self,
1329
+ reference: str,
1330
+ *,
1331
+ scope: m.GetGroupScope | None = None,
1332
+ options: RequestOptions | None = None,
1333
+ ) -> ApiResponse[m.GetGroupResource]:
1334
+ return cast(
1335
+ ApiResponse[m.GetGroupResource],
1336
+ resolve_reference(
1337
+ reference,
1338
+ lambda id: self.get_group(id, options=options),
1339
+ lambda match: self.list_groups(
1340
+ query=cast(m.ListGroupsQuery, {**reference_scope(scope), **match, "limit": 2}),
1341
+ options=options,
1342
+ ),
1343
+ True,
1344
+ "group",
1345
+ ),
1346
+ )
1347
+
1348
+ def get_group_inline_policy(
1349
+ self, group_id: str, policy_name: str, *, options: RequestOptions | None = None
1350
+ ) -> ApiResponse[m.GetGroupInlinePolicyResponse]:
1351
+ "Get a group's inline policy by name"
1352
+ return cast(
1353
+ ApiResponse[m.GetGroupInlinePolicyResponse],
1354
+ self._transport.request(
1355
+ "workspace",
1356
+ "https://workspace.basaltic.sh",
1357
+ _OPS["getGroupInlinePolicy"],
1358
+ "json",
1359
+ {"group_id": group_id, "policy_name": policy_name},
1360
+ UNSET,
1361
+ None,
1362
+ options,
1363
+ ),
1364
+ )
1365
+
1366
+ def get_group_inline_policy_by_reference(
1367
+ self,
1368
+ group_id: str,
1369
+ reference: str,
1370
+ *,
1371
+ scope: m.GetGroupInlinePolicyScope | None = None,
1372
+ options: RequestOptions | None = None,
1373
+ ) -> ApiResponse[m.GetGroupInlinePolicyResource]:
1374
+ return cast(
1375
+ ApiResponse[m.GetGroupInlinePolicyResource],
1376
+ resolve_reference(
1377
+ reference,
1378
+ lambda id: self.get_group_inline_policy(group_id, id, options=options),
1379
+ lambda match: self.list_group_inline_policies(
1380
+ group_id,
1381
+ query=cast(m.ListGroupInlinePoliciesQuery, {**reference_scope(scope), **match}),
1382
+ options=options,
1383
+ ),
1384
+ True,
1385
+ "inline_policy",
1386
+ ),
1387
+ )
1388
+
1389
+ def get_invitation(
1390
+ self, invitation_id: str, *, options: RequestOptions | None = None
1391
+ ) -> ApiResponse[m.GetInvitationResponse]:
1392
+ "Get invitation"
1393
+ return cast(
1394
+ ApiResponse[m.GetInvitationResponse],
1395
+ self._transport.request(
1396
+ "workspace",
1397
+ "https://workspace.basaltic.sh",
1398
+ _OPS["getInvitation"],
1399
+ "json",
1400
+ {"invitation_id": invitation_id},
1401
+ UNSET,
1402
+ None,
1403
+ options,
1404
+ ),
1405
+ )
1406
+
1407
+ def get_invitation_by_reference(
1408
+ self,
1409
+ reference: str,
1410
+ *,
1411
+ scope: m.GetInvitationScope | None = None,
1412
+ options: RequestOptions | None = None,
1413
+ ) -> ApiResponse[m.GetInvitationResource]:
1414
+ return cast(
1415
+ ApiResponse[m.GetInvitationResource],
1416
+ resolve_reference(
1417
+ reference,
1418
+ lambda id: self.get_invitation(id, options=options),
1419
+ lambda match: self.list_invitations(
1420
+ query=cast(
1421
+ m.ListInvitationsQuery, {**reference_scope(scope), **match, "limit": 2}
1422
+ ),
1423
+ options=options,
1424
+ ),
1425
+ True,
1426
+ "invitation",
1427
+ ),
1428
+ )
1429
+
1430
+ def get_organization(
1431
+ self, organization_id: str, *, options: RequestOptions | None = None
1432
+ ) -> ApiResponse[m.GetOrganizationResponse]:
1433
+ "Get organization"
1434
+ return cast(
1435
+ ApiResponse[m.GetOrganizationResponse],
1436
+ self._transport.request(
1437
+ "workspace",
1438
+ "https://workspace.basaltic.sh",
1439
+ _OPS["getOrganization"],
1440
+ "json",
1441
+ {"organization_id": organization_id},
1442
+ UNSET,
1443
+ None,
1444
+ options,
1445
+ ),
1446
+ )
1447
+
1448
+ def get_organization_by_reference(
1449
+ self,
1450
+ reference: str,
1451
+ *,
1452
+ scope: m.GetOrganizationScope | None = None,
1453
+ options: RequestOptions | None = None,
1454
+ ) -> ApiResponse[m.GetOrganizationResource]:
1455
+ return cast(
1456
+ ApiResponse[m.GetOrganizationResource],
1457
+ resolve_reference(
1458
+ reference,
1459
+ lambda id: self.get_organization(id, options=options),
1460
+ lambda match: self.list_organizations(
1461
+ query=cast(
1462
+ m.ListOrganizationsQuery, {**reference_scope(scope), **match, "limit": 2}
1463
+ ),
1464
+ options=options,
1465
+ ),
1466
+ True,
1467
+ "organization",
1468
+ ),
1469
+ )
1470
+
1471
+ def get_policy(
1472
+ self, policy_id: str, *, options: RequestOptions | None = None
1473
+ ) -> ApiResponse[m.GetPolicyResponse]:
1474
+ "Get policy"
1475
+ return cast(
1476
+ ApiResponse[m.GetPolicyResponse],
1477
+ self._transport.request(
1478
+ "workspace",
1479
+ "https://workspace.basaltic.sh",
1480
+ _OPS["getPolicy"],
1481
+ "json",
1482
+ {"policy_id": policy_id},
1483
+ UNSET,
1484
+ None,
1485
+ options,
1486
+ ),
1487
+ )
1488
+
1489
+ def get_policy_by_reference(
1490
+ self,
1491
+ reference: str,
1492
+ *,
1493
+ scope: m.GetPolicyScope | None = None,
1494
+ options: RequestOptions | None = None,
1495
+ ) -> ApiResponse[m.GetPolicyResource]:
1496
+ return cast(
1497
+ ApiResponse[m.GetPolicyResource],
1498
+ resolve_reference(
1499
+ reference,
1500
+ lambda id: self.get_policy(id, options=options),
1501
+ lambda match: self.list_policies(
1502
+ query=cast(
1503
+ m.ListPoliciesQuery, {**reference_scope(scope), **match, "limit": 2}
1504
+ ),
1505
+ options=options,
1506
+ ),
1507
+ True,
1508
+ "policy",
1509
+ ),
1510
+ )
1511
+
1512
+ def get_user(
1513
+ self, user_id: str, *, options: RequestOptions | None = None
1514
+ ) -> ApiResponse[m.GetUserResponse]:
1515
+ "Get user"
1516
+ return cast(
1517
+ ApiResponse[m.GetUserResponse],
1518
+ self._transport.request(
1519
+ "workspace",
1520
+ "https://workspace.basaltic.sh",
1521
+ _OPS["getUser"],
1522
+ "json",
1523
+ {"user_id": user_id},
1524
+ UNSET,
1525
+ None,
1526
+ options,
1527
+ ),
1528
+ )
1529
+
1530
+ def get_user_by_reference(
1531
+ self,
1532
+ reference: str,
1533
+ *,
1534
+ scope: m.GetUserScope | None = None,
1535
+ options: RequestOptions | None = None,
1536
+ ) -> ApiResponse[m.GetUserResource]:
1537
+ return cast(
1538
+ ApiResponse[m.GetUserResource],
1539
+ resolve_reference(
1540
+ reference,
1541
+ lambda id: self.get_user(id, options=options),
1542
+ lambda match: self.list_users(
1543
+ query=cast(m.ListUsersQuery, {**reference_scope(scope), **match, "limit": 2}),
1544
+ options=options,
1545
+ ),
1546
+ True,
1547
+ "user",
1548
+ ),
1549
+ )
1550
+
1551
+ def get_user_inline_policy(
1552
+ self, user_id: str, policy_name: str, *, options: RequestOptions | None = None
1553
+ ) -> ApiResponse[m.GetUserInlinePolicyResponse]:
1554
+ "Get a user's inline policy by name"
1555
+ return cast(
1556
+ ApiResponse[m.GetUserInlinePolicyResponse],
1557
+ self._transport.request(
1558
+ "workspace",
1559
+ "https://workspace.basaltic.sh",
1560
+ _OPS["getUserInlinePolicy"],
1561
+ "json",
1562
+ {"user_id": user_id, "policy_name": policy_name},
1563
+ UNSET,
1564
+ None,
1565
+ options,
1566
+ ),
1567
+ )
1568
+
1569
+ def get_user_inline_policy_by_reference(
1570
+ self,
1571
+ user_id: str,
1572
+ reference: str,
1573
+ *,
1574
+ scope: m.GetUserInlinePolicyScope | None = None,
1575
+ options: RequestOptions | None = None,
1576
+ ) -> ApiResponse[m.GetUserInlinePolicyResource]:
1577
+ return cast(
1578
+ ApiResponse[m.GetUserInlinePolicyResource],
1579
+ resolve_reference(
1580
+ reference,
1581
+ lambda id: self.get_user_inline_policy(user_id, id, options=options),
1582
+ lambda match: self.list_user_inline_policies(
1583
+ user_id,
1584
+ query=cast(m.ListUserInlinePoliciesQuery, {**reference_scope(scope), **match}),
1585
+ options=options,
1586
+ ),
1587
+ True,
1588
+ "inline_policy",
1589
+ ),
1590
+ )
1591
+
1592
+ def get_user_permission_boundary(
1593
+ self, user_id: str, *, options: RequestOptions | None = None
1594
+ ) -> ApiResponse[m.GetUserPermissionBoundaryResponse]:
1595
+ "Get a user's permission boundary"
1596
+ return cast(
1597
+ ApiResponse[m.GetUserPermissionBoundaryResponse],
1598
+ self._transport.request(
1599
+ "workspace",
1600
+ "https://workspace.basaltic.sh",
1601
+ _OPS["getUserPermissionBoundary"],
1602
+ "json",
1603
+ {"user_id": user_id},
1604
+ UNSET,
1605
+ None,
1606
+ options,
1607
+ ),
1608
+ )
1609
+
1610
+ def list_account_role_assignments(
1611
+ self, account_id: str, *, options: RequestOptions | None = None
1612
+ ) -> Page[m.ListAccountRoleAssignmentsResponse, m.ListAccountRoleAssignmentsItem]:
1613
+ "List account role assignments"
1614
+ return cast(
1615
+ Page[m.ListAccountRoleAssignmentsResponse, m.ListAccountRoleAssignmentsItem],
1616
+ self._transport.request(
1617
+ "workspace",
1618
+ "https://workspace.basaltic.sh",
1619
+ _OPS["listAccountRoleAssignments"],
1620
+ "page",
1621
+ {"account_id": account_id},
1622
+ UNSET,
1623
+ None,
1624
+ options,
1625
+ ),
1626
+ )
1627
+
1628
+ def list_account_roles(
1629
+ self, *, options: RequestOptions | None = None
1630
+ ) -> Page[m.ListAccountRolesResponse, m.ListAccountRolesItem]:
1631
+ "List assigned account roles"
1632
+ return cast(
1633
+ Page[m.ListAccountRolesResponse, m.ListAccountRolesItem],
1634
+ self._transport.request(
1635
+ "workspace",
1636
+ "https://workspace.basaltic.sh",
1637
+ _OPS["listAccountRoles"],
1638
+ "page",
1639
+ {},
1640
+ UNSET,
1641
+ None,
1642
+ options,
1643
+ ),
1644
+ )
1645
+
1646
+ def list_accounts(
1647
+ self, *, query: m.ListAccountsQuery | None = None, options: RequestOptions | None = None
1648
+ ) -> Page[m.ListAccountsResponse, m.ListAccountsItem]:
1649
+ "List accounts"
1650
+ return cast(
1651
+ Page[m.ListAccountsResponse, m.ListAccountsItem],
1652
+ self._transport.request(
1653
+ "workspace",
1654
+ "https://workspace.basaltic.sh",
1655
+ _OPS["listAccounts"],
1656
+ "page",
1657
+ {},
1658
+ UNSET,
1659
+ query,
1660
+ options,
1661
+ ),
1662
+ )
1663
+
1664
+ def list_accounts_all(
1665
+ self, *, query: m.ListAccountsQuery | None = None, options: RequestOptions | None = None
1666
+ ) -> Iterator[m.ListAccountsItem]:
1667
+ return iterate_pages(
1668
+ lambda marker: self.list_accounts(
1669
+ query=cast(m.ListAccountsQuery, {**(query or {}), "marker": marker}),
1670
+ options=options,
1671
+ ),
1672
+ (query or {}).get("marker", ""),
1673
+ )
1674
+
1675
+ def list_group_inline_policies(
1676
+ self,
1677
+ group_id: str,
1678
+ *,
1679
+ query: m.ListGroupInlinePoliciesQuery | None = None,
1680
+ options: RequestOptions | None = None,
1681
+ ) -> Page[m.ListGroupInlinePoliciesResponse, m.ListGroupInlinePoliciesItem]:
1682
+ "List a group's inline policies"
1683
+ return cast(
1684
+ Page[m.ListGroupInlinePoliciesResponse, m.ListGroupInlinePoliciesItem],
1685
+ self._transport.request(
1686
+ "workspace",
1687
+ "https://workspace.basaltic.sh",
1688
+ _OPS["listGroupInlinePolicies"],
1689
+ "page",
1690
+ {"group_id": group_id},
1691
+ UNSET,
1692
+ query,
1693
+ options,
1694
+ ),
1695
+ )
1696
+
1697
+ def list_group_policies(
1698
+ self,
1699
+ group_id: str,
1700
+ *,
1701
+ query: m.ListGroupPoliciesQuery | None = None,
1702
+ options: RequestOptions | None = None,
1703
+ ) -> Page[m.ListGroupPoliciesResponse, m.ListGroupPoliciesItem]:
1704
+ "List group policies"
1705
+ return cast(
1706
+ Page[m.ListGroupPoliciesResponse, m.ListGroupPoliciesItem],
1707
+ self._transport.request(
1708
+ "workspace",
1709
+ "https://workspace.basaltic.sh",
1710
+ _OPS["listGroupPolicies"],
1711
+ "page",
1712
+ {"group_id": group_id},
1713
+ UNSET,
1714
+ query,
1715
+ options,
1716
+ ),
1717
+ )
1718
+
1719
+ def list_group_users(
1720
+ self,
1721
+ group_id: str,
1722
+ *,
1723
+ query: m.ListGroupUsersQuery | None = None,
1724
+ options: RequestOptions | None = None,
1725
+ ) -> Page[m.ListGroupUsersResponse, m.ListGroupUsersItem]:
1726
+ "List group users"
1727
+ return cast(
1728
+ Page[m.ListGroupUsersResponse, m.ListGroupUsersItem],
1729
+ self._transport.request(
1730
+ "workspace",
1731
+ "https://workspace.basaltic.sh",
1732
+ _OPS["listGroupUsers"],
1733
+ "page",
1734
+ {"group_id": group_id},
1735
+ UNSET,
1736
+ query,
1737
+ options,
1738
+ ),
1739
+ )
1740
+
1741
+ def list_group_users_all(
1742
+ self,
1743
+ group_id: str,
1744
+ *,
1745
+ query: m.ListGroupUsersQuery | None = None,
1746
+ options: RequestOptions | None = None,
1747
+ ) -> Iterator[m.ListGroupUsersItem]:
1748
+ return iterate_pages(
1749
+ lambda marker: self.list_group_users(
1750
+ group_id,
1751
+ query=cast(m.ListGroupUsersQuery, {**(query or {}), "marker": marker}),
1752
+ options=options,
1753
+ ),
1754
+ (query or {}).get("marker", ""),
1755
+ )
1756
+
1757
+ def list_groups(
1758
+ self, *, query: m.ListGroupsQuery | None = None, options: RequestOptions | None = None
1759
+ ) -> Page[m.ListGroupsResponse, m.ListGroupsItem]:
1760
+ "List groups"
1761
+ return cast(
1762
+ Page[m.ListGroupsResponse, m.ListGroupsItem],
1763
+ self._transport.request(
1764
+ "workspace",
1765
+ "https://workspace.basaltic.sh",
1766
+ _OPS["listGroups"],
1767
+ "page",
1768
+ {},
1769
+ UNSET,
1770
+ query,
1771
+ options,
1772
+ ),
1773
+ )
1774
+
1775
+ def list_groups_all(
1776
+ self, *, query: m.ListGroupsQuery | None = None, options: RequestOptions | None = None
1777
+ ) -> Iterator[m.ListGroupsItem]:
1778
+ return iterate_pages(
1779
+ lambda marker: self.list_groups(
1780
+ query=cast(m.ListGroupsQuery, {**(query or {}), "marker": marker}), options=options
1781
+ ),
1782
+ (query or {}).get("marker", ""),
1783
+ )
1784
+
1785
+ def list_invitations(
1786
+ self, *, query: m.ListInvitationsQuery | None = None, options: RequestOptions | None = None
1787
+ ) -> Page[m.ListInvitationsResponse, m.ListInvitationsItem]:
1788
+ "List invitations"
1789
+ return cast(
1790
+ Page[m.ListInvitationsResponse, m.ListInvitationsItem],
1791
+ self._transport.request(
1792
+ "workspace",
1793
+ "https://workspace.basaltic.sh",
1794
+ _OPS["listInvitations"],
1795
+ "page",
1796
+ {},
1797
+ UNSET,
1798
+ query,
1799
+ options,
1800
+ ),
1801
+ )
1802
+
1803
+ def list_invitations_all(
1804
+ self, *, query: m.ListInvitationsQuery | None = None, options: RequestOptions | None = None
1805
+ ) -> Iterator[m.ListInvitationsItem]:
1806
+ return iterate_pages(
1807
+ lambda marker: self.list_invitations(
1808
+ query=cast(m.ListInvitationsQuery, {**(query or {}), "marker": marker}),
1809
+ options=options,
1810
+ ),
1811
+ (query or {}).get("marker", ""),
1812
+ )
1813
+
1814
+ def list_organizations(
1815
+ self,
1816
+ *,
1817
+ query: m.ListOrganizationsQuery | None = None,
1818
+ options: RequestOptions | None = None,
1819
+ ) -> Page[m.ListOrganizationsResponse, m.ListOrganizationsItem]:
1820
+ "List organizations"
1821
+ return cast(
1822
+ Page[m.ListOrganizationsResponse, m.ListOrganizationsItem],
1823
+ self._transport.request(
1824
+ "workspace",
1825
+ "https://workspace.basaltic.sh",
1826
+ _OPS["listOrganizations"],
1827
+ "page",
1828
+ {},
1829
+ UNSET,
1830
+ query,
1831
+ options,
1832
+ ),
1833
+ )
1834
+
1835
+ def list_organizations_all(
1836
+ self,
1837
+ *,
1838
+ query: m.ListOrganizationsQuery | None = None,
1839
+ options: RequestOptions | None = None,
1840
+ ) -> Iterator[m.ListOrganizationsItem]:
1841
+ return iterate_pages(
1842
+ lambda marker: self.list_organizations(
1843
+ query=cast(m.ListOrganizationsQuery, {**(query or {}), "marker": marker}),
1844
+ options=options,
1845
+ ),
1846
+ (query or {}).get("marker", ""),
1847
+ )
1848
+
1849
+ def list_policies(
1850
+ self, *, query: m.ListPoliciesQuery | None = None, options: RequestOptions | None = None
1851
+ ) -> Page[m.ListPoliciesResponse, m.ListPoliciesItem]:
1852
+ "List policies"
1853
+ return cast(
1854
+ Page[m.ListPoliciesResponse, m.ListPoliciesItem],
1855
+ self._transport.request(
1856
+ "workspace",
1857
+ "https://workspace.basaltic.sh",
1858
+ _OPS["listPolicies"],
1859
+ "page",
1860
+ {},
1861
+ UNSET,
1862
+ query,
1863
+ options,
1864
+ ),
1865
+ )
1866
+
1867
+ def list_policies_all(
1868
+ self, *, query: m.ListPoliciesQuery | None = None, options: RequestOptions | None = None
1869
+ ) -> Iterator[m.ListPoliciesItem]:
1870
+ return iterate_pages(
1871
+ lambda marker: self.list_policies(
1872
+ query=cast(m.ListPoliciesQuery, {**(query or {}), "marker": marker}),
1873
+ options=options,
1874
+ ),
1875
+ (query or {}).get("marker", ""),
1876
+ )
1877
+
1878
+ def list_policy_groups(
1879
+ self,
1880
+ policy_id: str,
1881
+ *,
1882
+ query: m.ListPolicyGroupsQuery | None = None,
1883
+ options: RequestOptions | None = None,
1884
+ ) -> Page[m.ListPolicyGroupsResponse, m.ListPolicyGroupsItem]:
1885
+ "List groups with policy"
1886
+ return cast(
1887
+ Page[m.ListPolicyGroupsResponse, m.ListPolicyGroupsItem],
1888
+ self._transport.request(
1889
+ "workspace",
1890
+ "https://workspace.basaltic.sh",
1891
+ _OPS["listPolicyGroups"],
1892
+ "page",
1893
+ {"policy_id": policy_id},
1894
+ UNSET,
1895
+ query,
1896
+ options,
1897
+ ),
1898
+ )
1899
+
1900
+ def list_policy_groups_all(
1901
+ self,
1902
+ policy_id: str,
1903
+ *,
1904
+ query: m.ListPolicyGroupsQuery | None = None,
1905
+ options: RequestOptions | None = None,
1906
+ ) -> Iterator[m.ListPolicyGroupsItem]:
1907
+ return iterate_pages(
1908
+ lambda marker: self.list_policy_groups(
1909
+ policy_id,
1910
+ query=cast(m.ListPolicyGroupsQuery, {**(query or {}), "marker": marker}),
1911
+ options=options,
1912
+ ),
1913
+ (query or {}).get("marker", ""),
1914
+ )
1915
+
1916
+ def list_policy_roles(
1917
+ self,
1918
+ policy_id: str,
1919
+ *,
1920
+ query: m.ListPolicyRolesQuery | None = None,
1921
+ options: RequestOptions | None = None,
1922
+ ) -> Page[m.ListPolicyRolesResponse, m.ListPolicyRolesItem]:
1923
+ "List roles with policy"
1924
+ return cast(
1925
+ Page[m.ListPolicyRolesResponse, m.ListPolicyRolesItem],
1926
+ self._transport.request(
1927
+ "workspace",
1928
+ "https://workspace.basaltic.sh",
1929
+ _OPS["listPolicyRoles"],
1930
+ "page",
1931
+ {"policy_id": policy_id},
1932
+ UNSET,
1933
+ query,
1934
+ options,
1935
+ ),
1936
+ )
1937
+
1938
+ def list_policy_roles_all(
1939
+ self,
1940
+ policy_id: str,
1941
+ *,
1942
+ query: m.ListPolicyRolesQuery | None = None,
1943
+ options: RequestOptions | None = None,
1944
+ ) -> Iterator[m.ListPolicyRolesItem]:
1945
+ return iterate_pages(
1946
+ lambda marker: self.list_policy_roles(
1947
+ policy_id,
1948
+ query=cast(m.ListPolicyRolesQuery, {**(query or {}), "marker": marker}),
1949
+ options=options,
1950
+ ),
1951
+ (query or {}).get("marker", ""),
1952
+ )
1953
+
1954
+ def list_policy_service_accounts(
1955
+ self,
1956
+ policy_id: str,
1957
+ *,
1958
+ query: m.ListPolicyServiceAccountsQuery | None = None,
1959
+ options: RequestOptions | None = None,
1960
+ ) -> Page[m.ListPolicyServiceAccountsResponse, m.ListPolicyServiceAccountsItem]:
1961
+ "List service accounts with policy"
1962
+ return cast(
1963
+ Page[m.ListPolicyServiceAccountsResponse, m.ListPolicyServiceAccountsItem],
1964
+ self._transport.request(
1965
+ "workspace",
1966
+ "https://workspace.basaltic.sh",
1967
+ _OPS["listPolicyServiceAccounts"],
1968
+ "page",
1969
+ {"policy_id": policy_id},
1970
+ UNSET,
1971
+ query,
1972
+ options,
1973
+ ),
1974
+ )
1975
+
1976
+ def list_policy_service_accounts_all(
1977
+ self,
1978
+ policy_id: str,
1979
+ *,
1980
+ query: m.ListPolicyServiceAccountsQuery | None = None,
1981
+ options: RequestOptions | None = None,
1982
+ ) -> Iterator[m.ListPolicyServiceAccountsItem]:
1983
+ return iterate_pages(
1984
+ lambda marker: self.list_policy_service_accounts(
1985
+ policy_id,
1986
+ query=cast(m.ListPolicyServiceAccountsQuery, {**(query or {}), "marker": marker}),
1987
+ options=options,
1988
+ ),
1989
+ (query or {}).get("marker", ""),
1990
+ )
1991
+
1992
+ def list_policy_users(
1993
+ self,
1994
+ policy_id: str,
1995
+ *,
1996
+ query: m.ListPolicyUsersQuery | None = None,
1997
+ options: RequestOptions | None = None,
1998
+ ) -> Page[m.ListPolicyUsersResponse, m.ListPolicyUsersItem]:
1999
+ "List users with policy"
2000
+ return cast(
2001
+ Page[m.ListPolicyUsersResponse, m.ListPolicyUsersItem],
2002
+ self._transport.request(
2003
+ "workspace",
2004
+ "https://workspace.basaltic.sh",
2005
+ _OPS["listPolicyUsers"],
2006
+ "page",
2007
+ {"policy_id": policy_id},
2008
+ UNSET,
2009
+ query,
2010
+ options,
2011
+ ),
2012
+ )
2013
+
2014
+ def list_policy_users_all(
2015
+ self,
2016
+ policy_id: str,
2017
+ *,
2018
+ query: m.ListPolicyUsersQuery | None = None,
2019
+ options: RequestOptions | None = None,
2020
+ ) -> Iterator[m.ListPolicyUsersItem]:
2021
+ return iterate_pages(
2022
+ lambda marker: self.list_policy_users(
2023
+ policy_id,
2024
+ query=cast(m.ListPolicyUsersQuery, {**(query or {}), "marker": marker}),
2025
+ options=options,
2026
+ ),
2027
+ (query or {}).get("marker", ""),
2028
+ )
2029
+
2030
+ def list_role_policies(
2031
+ self,
2032
+ role_id: str,
2033
+ *,
2034
+ query: m.ListRolePoliciesQuery | None = None,
2035
+ options: RequestOptions | None = None,
2036
+ ) -> Page[m.ListRolePoliciesResponse, m.ListRolePoliciesItem]:
2037
+ "List role policies"
2038
+ return cast(
2039
+ Page[m.ListRolePoliciesResponse, m.ListRolePoliciesItem],
2040
+ self._transport.request(
2041
+ "workspace",
2042
+ "https://workspace.basaltic.sh",
2043
+ _OPS["listRolePolicies"],
2044
+ "page",
2045
+ {"role_id": role_id},
2046
+ UNSET,
2047
+ query,
2048
+ options,
2049
+ ),
2050
+ )
2051
+
2052
+ def list_service_account_policies(
2053
+ self,
2054
+ service_account_id: str,
2055
+ *,
2056
+ query: m.ListServiceAccountPoliciesQuery | None = None,
2057
+ options: RequestOptions | None = None,
2058
+ ) -> Page[m.ListServiceAccountPoliciesResponse, m.ListServiceAccountPoliciesItem]:
2059
+ "List service account policies"
2060
+ return cast(
2061
+ Page[m.ListServiceAccountPoliciesResponse, m.ListServiceAccountPoliciesItem],
2062
+ self._transport.request(
2063
+ "workspace",
2064
+ "https://workspace.basaltic.sh",
2065
+ _OPS["listServiceAccountPolicies"],
2066
+ "page",
2067
+ {"service_account_id": service_account_id},
2068
+ UNSET,
2069
+ query,
2070
+ options,
2071
+ ),
2072
+ )
2073
+
2074
+ def list_user_groups(
2075
+ self,
2076
+ user_id: str,
2077
+ *,
2078
+ query: m.ListUserGroupsQuery | None = None,
2079
+ options: RequestOptions | None = None,
2080
+ ) -> Page[m.ListUserGroupsResponse, m.ListUserGroupsItem]:
2081
+ "List user groups"
2082
+ return cast(
2083
+ Page[m.ListUserGroupsResponse, m.ListUserGroupsItem],
2084
+ self._transport.request(
2085
+ "workspace",
2086
+ "https://workspace.basaltic.sh",
2087
+ _OPS["listUserGroups"],
2088
+ "page",
2089
+ {"user_id": user_id},
2090
+ UNSET,
2091
+ query,
2092
+ options,
2093
+ ),
2094
+ )
2095
+
2096
+ def list_user_inline_policies(
2097
+ self,
2098
+ user_id: str,
2099
+ *,
2100
+ query: m.ListUserInlinePoliciesQuery | None = None,
2101
+ options: RequestOptions | None = None,
2102
+ ) -> Page[m.ListUserInlinePoliciesResponse, m.ListUserInlinePoliciesItem]:
2103
+ "List a user's inline policies"
2104
+ return cast(
2105
+ Page[m.ListUserInlinePoliciesResponse, m.ListUserInlinePoliciesItem],
2106
+ self._transport.request(
2107
+ "workspace",
2108
+ "https://workspace.basaltic.sh",
2109
+ _OPS["listUserInlinePolicies"],
2110
+ "page",
2111
+ {"user_id": user_id},
2112
+ UNSET,
2113
+ query,
2114
+ options,
2115
+ ),
2116
+ )
2117
+
2118
+ def list_user_policies(
2119
+ self,
2120
+ user_id: str,
2121
+ *,
2122
+ query: m.ListUserPoliciesQuery | None = None,
2123
+ options: RequestOptions | None = None,
2124
+ ) -> Page[m.ListUserPoliciesResponse, m.ListUserPoliciesItem]:
2125
+ "List user policies"
2126
+ return cast(
2127
+ Page[m.ListUserPoliciesResponse, m.ListUserPoliciesItem],
2128
+ self._transport.request(
2129
+ "workspace",
2130
+ "https://workspace.basaltic.sh",
2131
+ _OPS["listUserPolicies"],
2132
+ "page",
2133
+ {"user_id": user_id},
2134
+ UNSET,
2135
+ query,
2136
+ options,
2137
+ ),
2138
+ )
2139
+
2140
+ def list_users(
2141
+ self, *, query: m.ListUsersQuery | None = None, options: RequestOptions | None = None
2142
+ ) -> Page[m.ListUsersResponse, m.ListUsersItem]:
2143
+ "List users"
2144
+ return cast(
2145
+ Page[m.ListUsersResponse, m.ListUsersItem],
2146
+ self._transport.request(
2147
+ "workspace",
2148
+ "https://workspace.basaltic.sh",
2149
+ _OPS["listUsers"],
2150
+ "page",
2151
+ {},
2152
+ UNSET,
2153
+ query,
2154
+ options,
2155
+ ),
2156
+ )
2157
+
2158
+ def list_users_all(
2159
+ self, *, query: m.ListUsersQuery | None = None, options: RequestOptions | None = None
2160
+ ) -> Iterator[m.ListUsersItem]:
2161
+ return iterate_pages(
2162
+ lambda marker: self.list_users(
2163
+ query=cast(m.ListUsersQuery, {**(query or {}), "marker": marker}), options=options
2164
+ ),
2165
+ (query or {}).get("marker", ""),
2166
+ )
2167
+
2168
+ def put_group_inline_policy(
2169
+ self,
2170
+ group_id: str,
2171
+ policy_name: str,
2172
+ body: m.PutGroupInlinePolicyBody,
2173
+ *,
2174
+ options: RequestOptions | None = None,
2175
+ ) -> ApiResponse[m.PutGroupInlinePolicyResponse]:
2176
+ "Create or replace a group's inline policy"
2177
+ return cast(
2178
+ ApiResponse[m.PutGroupInlinePolicyResponse],
2179
+ self._transport.request(
2180
+ "workspace",
2181
+ "https://workspace.basaltic.sh",
2182
+ _OPS["putGroupInlinePolicy"],
2183
+ "json",
2184
+ {"group_id": group_id, "policy_name": policy_name},
2185
+ body,
2186
+ None,
2187
+ options,
2188
+ ),
2189
+ )
2190
+
2191
+ def put_user_inline_policy(
2192
+ self,
2193
+ user_id: str,
2194
+ policy_name: str,
2195
+ body: m.PutUserInlinePolicyBody,
2196
+ *,
2197
+ options: RequestOptions | None = None,
2198
+ ) -> ApiResponse[m.PutUserInlinePolicyResponse]:
2199
+ "Create or replace a user's inline policy"
2200
+ return cast(
2201
+ ApiResponse[m.PutUserInlinePolicyResponse],
2202
+ self._transport.request(
2203
+ "workspace",
2204
+ "https://workspace.basaltic.sh",
2205
+ _OPS["putUserInlinePolicy"],
2206
+ "json",
2207
+ {"user_id": user_id, "policy_name": policy_name},
2208
+ body,
2209
+ None,
2210
+ options,
2211
+ ),
2212
+ )
2213
+
2214
+ def remove_account_role_assignment(
2215
+ self, account_id: str, assignment_id: str, *, options: RequestOptions | None = None
2216
+ ) -> None:
2217
+ "Remove account role assignment"
2218
+ return cast(
2219
+ None,
2220
+ self._transport.request(
2221
+ "workspace",
2222
+ "https://workspace.basaltic.sh",
2223
+ _OPS["removeAccountRoleAssignment"],
2224
+ "discard",
2225
+ {"account_id": account_id, "assignment_id": assignment_id},
2226
+ UNSET,
2227
+ None,
2228
+ options,
2229
+ ),
2230
+ )
2231
+
2232
+ def remove_user(self, user_id: str, *, options: RequestOptions | None = None) -> None:
2233
+ "Remove user from organization"
2234
+ return cast(
2235
+ None,
2236
+ self._transport.request(
2237
+ "workspace",
2238
+ "https://workspace.basaltic.sh",
2239
+ _OPS["removeUser"],
2240
+ "discard",
2241
+ {"user_id": user_id},
2242
+ UNSET,
2243
+ None,
2244
+ options,
2245
+ ),
2246
+ )
2247
+
2248
+ def remove_user_from_group(
2249
+ self, user_id: str, group_id: str, *, options: RequestOptions | None = None
2250
+ ) -> None:
2251
+ "Remove user from group"
2252
+ return cast(
2253
+ None,
2254
+ self._transport.request(
2255
+ "workspace",
2256
+ "https://workspace.basaltic.sh",
2257
+ _OPS["removeUserFromGroup"],
2258
+ "discard",
2259
+ {"user_id": user_id, "group_id": group_id},
2260
+ UNSET,
2261
+ None,
2262
+ options,
2263
+ ),
2264
+ )
2265
+
2266
+ def remove_user_permission_boundary(
2267
+ self, user_id: str, *, options: RequestOptions | None = None
2268
+ ) -> None:
2269
+ "Remove a user's permission boundary"
2270
+ return cast(
2271
+ None,
2272
+ self._transport.request(
2273
+ "workspace",
2274
+ "https://workspace.basaltic.sh",
2275
+ _OPS["removeUserPermissionBoundary"],
2276
+ "discard",
2277
+ {"user_id": user_id},
2278
+ UNSET,
2279
+ None,
2280
+ options,
2281
+ ),
2282
+ )
2283
+
2284
+ def set_user_permission_boundary(
2285
+ self,
2286
+ user_id: str,
2287
+ body: m.SetUserPermissionBoundaryBody,
2288
+ *,
2289
+ options: RequestOptions | None = None,
2290
+ ) -> None:
2291
+ "Set a user's permission boundary"
2292
+ return cast(
2293
+ None,
2294
+ self._transport.request(
2295
+ "workspace",
2296
+ "https://workspace.basaltic.sh",
2297
+ _OPS["setUserPermissionBoundary"],
2298
+ "discard",
2299
+ {"user_id": user_id},
2300
+ body,
2301
+ None,
2302
+ options,
2303
+ ),
2304
+ )
2305
+
2306
+ def update_account(
2307
+ self, account_id: str, body: m.UpdateAccountBody, *, options: RequestOptions | None = None
2308
+ ) -> ApiResponse[m.UpdateAccountResponse]:
2309
+ "Update account"
2310
+ return cast(
2311
+ ApiResponse[m.UpdateAccountResponse],
2312
+ self._transport.request(
2313
+ "workspace",
2314
+ "https://workspace.basaltic.sh",
2315
+ _OPS["updateAccount"],
2316
+ "json",
2317
+ {"account_id": account_id},
2318
+ body,
2319
+ None,
2320
+ options,
2321
+ ),
2322
+ )
2323
+
2324
+ def update_group(
2325
+ self, group_id: str, body: m.UpdateGroupBody, *, options: RequestOptions | None = None
2326
+ ) -> ApiResponse[m.UpdateGroupResponse]:
2327
+ "Update group"
2328
+ return cast(
2329
+ ApiResponse[m.UpdateGroupResponse],
2330
+ self._transport.request(
2331
+ "workspace",
2332
+ "https://workspace.basaltic.sh",
2333
+ _OPS["updateGroup"],
2334
+ "json",
2335
+ {"group_id": group_id},
2336
+ body,
2337
+ None,
2338
+ options,
2339
+ ),
2340
+ )
2341
+
2342
+ def update_organization(
2343
+ self,
2344
+ organization_id: str,
2345
+ body: m.UpdateOrganizationBody,
2346
+ *,
2347
+ options: RequestOptions | None = None,
2348
+ ) -> ApiResponse[m.UpdateOrganizationResponse]:
2349
+ "Update organization"
2350
+ return cast(
2351
+ ApiResponse[m.UpdateOrganizationResponse],
2352
+ self._transport.request(
2353
+ "workspace",
2354
+ "https://workspace.basaltic.sh",
2355
+ _OPS["updateOrganization"],
2356
+ "json",
2357
+ {"organization_id": organization_id},
2358
+ body,
2359
+ None,
2360
+ options,
2361
+ ),
2362
+ )
2363
+
2364
+ def update_policy(
2365
+ self, policy_id: str, body: m.UpdatePolicyBody, *, options: RequestOptions | None = None
2366
+ ) -> ApiResponse[m.UpdatePolicyResponse]:
2367
+ "Update policy"
2368
+ return cast(
2369
+ ApiResponse[m.UpdatePolicyResponse],
2370
+ self._transport.request(
2371
+ "workspace",
2372
+ "https://workspace.basaltic.sh",
2373
+ _OPS["updatePolicy"],
2374
+ "json",
2375
+ {"policy_id": policy_id},
2376
+ body,
2377
+ None,
2378
+ options,
2379
+ ),
2380
+ )
2381
+
2382
+
2383
+ class AsyncWorkspaceService:
2384
+ def __init__(self, transport: AsyncTransport) -> None:
2385
+ self._transport = transport
2386
+
2387
+ async def add_user(
2388
+ self, body: m.AddUserBody, *, options: RequestOptions | None = None
2389
+ ) -> ApiResponse[m.AddUserResponse]:
2390
+ "Add user to organization"
2391
+ return cast(
2392
+ ApiResponse[m.AddUserResponse],
2393
+ await self._transport.request(
2394
+ "workspace",
2395
+ "https://workspace.basaltic.sh",
2396
+ _OPS["addUser"],
2397
+ "json",
2398
+ {},
2399
+ body,
2400
+ None,
2401
+ options,
2402
+ ),
2403
+ )
2404
+
2405
+ async def add_user_to_group(
2406
+ self, user_id: str, body: m.AddUserToGroupBody, *, options: RequestOptions | None = None
2407
+ ) -> None:
2408
+ "Add user to group"
2409
+ return cast(
2410
+ None,
2411
+ await self._transport.request(
2412
+ "workspace",
2413
+ "https://workspace.basaltic.sh",
2414
+ _OPS["addUserToGroup"],
2415
+ "discard",
2416
+ {"user_id": user_id},
2417
+ body,
2418
+ None,
2419
+ options,
2420
+ ),
2421
+ )
2422
+
2423
+ async def assign_account_role(
2424
+ self,
2425
+ account_id: str,
2426
+ body: m.AssignAccountRoleBody,
2427
+ *,
2428
+ options: RequestOptions | None = None,
2429
+ ) -> ApiResponse[m.AssignAccountRoleResponse]:
2430
+ "Assign account role"
2431
+ return cast(
2432
+ ApiResponse[m.AssignAccountRoleResponse],
2433
+ await self._transport.request(
2434
+ "workspace",
2435
+ "https://workspace.basaltic.sh",
2436
+ _OPS["assignAccountRole"],
2437
+ "json",
2438
+ {"account_id": account_id},
2439
+ body,
2440
+ None,
2441
+ options,
2442
+ ),
2443
+ )
2444
+
2445
+ async def attach_group_policy(
2446
+ self, group_id: str, body: m.AttachGroupPolicyBody, *, options: RequestOptions | None = None
2447
+ ) -> None:
2448
+ "Attach policy to group"
2449
+ return cast(
2450
+ None,
2451
+ await self._transport.request(
2452
+ "workspace",
2453
+ "https://workspace.basaltic.sh",
2454
+ _OPS["attachGroupPolicy"],
2455
+ "discard",
2456
+ {"group_id": group_id},
2457
+ body,
2458
+ None,
2459
+ options,
2460
+ ),
2461
+ )
2462
+
2463
+ async def attach_role_policy(
2464
+ self, role_id: str, body: m.AttachRolePolicyBody, *, options: RequestOptions | None = None
2465
+ ) -> None:
2466
+ "Attach policy to role"
2467
+ return cast(
2468
+ None,
2469
+ await self._transport.request(
2470
+ "workspace",
2471
+ "https://workspace.basaltic.sh",
2472
+ _OPS["attachRolePolicy"],
2473
+ "discard",
2474
+ {"role_id": role_id},
2475
+ body,
2476
+ None,
2477
+ options,
2478
+ ),
2479
+ )
2480
+
2481
+ async def attach_service_account_policy(
2482
+ self,
2483
+ service_account_id: str,
2484
+ body: m.AttachServiceAccountPolicyBody,
2485
+ *,
2486
+ options: RequestOptions | None = None,
2487
+ ) -> None:
2488
+ "Attach policy to service account"
2489
+ return cast(
2490
+ None,
2491
+ await self._transport.request(
2492
+ "workspace",
2493
+ "https://workspace.basaltic.sh",
2494
+ _OPS["attachServiceAccountPolicy"],
2495
+ "discard",
2496
+ {"service_account_id": service_account_id},
2497
+ body,
2498
+ None,
2499
+ options,
2500
+ ),
2501
+ )
2502
+
2503
+ async def attach_user_policy(
2504
+ self, user_id: str, body: m.AttachUserPolicyBody, *, options: RequestOptions | None = None
2505
+ ) -> None:
2506
+ "Attach policy to user"
2507
+ return cast(
2508
+ None,
2509
+ await self._transport.request(
2510
+ "workspace",
2511
+ "https://workspace.basaltic.sh",
2512
+ _OPS["attachUserPolicy"],
2513
+ "discard",
2514
+ {"user_id": user_id},
2515
+ body,
2516
+ None,
2517
+ options,
2518
+ ),
2519
+ )
2520
+
2521
+ async def cancel_invitation(
2522
+ self, invitation_id: str, *, options: RequestOptions | None = None
2523
+ ) -> None:
2524
+ "Cancel invitation"
2525
+ return cast(
2526
+ None,
2527
+ await self._transport.request(
2528
+ "workspace",
2529
+ "https://workspace.basaltic.sh",
2530
+ _OPS["cancelInvitation"],
2531
+ "discard",
2532
+ {"invitation_id": invitation_id},
2533
+ UNSET,
2534
+ None,
2535
+ options,
2536
+ ),
2537
+ )
2538
+
2539
+ async def create_account(
2540
+ self, body: m.CreateAccountBody, *, options: RequestOptions | None = None
2541
+ ) -> ApiResponse[m.CreateAccountResponse]:
2542
+ "Create account"
2543
+ return cast(
2544
+ ApiResponse[m.CreateAccountResponse],
2545
+ await self._transport.request(
2546
+ "workspace",
2547
+ "https://workspace.basaltic.sh",
2548
+ _OPS["createAccount"],
2549
+ "json",
2550
+ {},
2551
+ body,
2552
+ None,
2553
+ options,
2554
+ ),
2555
+ )
2556
+
2557
+ async def create_group(
2558
+ self, body: m.CreateGroupBody, *, options: RequestOptions | None = None
2559
+ ) -> ApiResponse[m.CreateGroupResponse]:
2560
+ "Create group"
2561
+ return cast(
2562
+ ApiResponse[m.CreateGroupResponse],
2563
+ await self._transport.request(
2564
+ "workspace",
2565
+ "https://workspace.basaltic.sh",
2566
+ _OPS["createGroup"],
2567
+ "json",
2568
+ {},
2569
+ body,
2570
+ None,
2571
+ options,
2572
+ ),
2573
+ )
2574
+
2575
+ async def create_policy(
2576
+ self, body: m.CreatePolicyBody, *, options: RequestOptions | None = None
2577
+ ) -> ApiResponse[m.CreatePolicyResponse]:
2578
+ "Create policy"
2579
+ return cast(
2580
+ ApiResponse[m.CreatePolicyResponse],
2581
+ await self._transport.request(
2582
+ "workspace",
2583
+ "https://workspace.basaltic.sh",
2584
+ _OPS["createPolicy"],
2585
+ "json",
2586
+ {},
2587
+ body,
2588
+ None,
2589
+ options,
2590
+ ),
2591
+ )
2592
+
2593
+ async def delete_account(
2594
+ self, account_id: str, *, options: RequestOptions | None = None
2595
+ ) -> None:
2596
+ "Delete account"
2597
+ return cast(
2598
+ None,
2599
+ await self._transport.request(
2600
+ "workspace",
2601
+ "https://workspace.basaltic.sh",
2602
+ _OPS["deleteAccount"],
2603
+ "discard",
2604
+ {"account_id": account_id},
2605
+ UNSET,
2606
+ None,
2607
+ options,
2608
+ ),
2609
+ )
2610
+
2611
+ async def delete_group(self, group_id: str, *, options: RequestOptions | None = None) -> None:
2612
+ "Delete group"
2613
+ return cast(
2614
+ None,
2615
+ await self._transport.request(
2616
+ "workspace",
2617
+ "https://workspace.basaltic.sh",
2618
+ _OPS["deleteGroup"],
2619
+ "discard",
2620
+ {"group_id": group_id},
2621
+ UNSET,
2622
+ None,
2623
+ options,
2624
+ ),
2625
+ )
2626
+
2627
+ async def delete_group_inline_policy(
2628
+ self, group_id: str, policy_name: str, *, options: RequestOptions | None = None
2629
+ ) -> None:
2630
+ "Delete a group's inline policy by name"
2631
+ return cast(
2632
+ None,
2633
+ await self._transport.request(
2634
+ "workspace",
2635
+ "https://workspace.basaltic.sh",
2636
+ _OPS["deleteGroupInlinePolicy"],
2637
+ "discard",
2638
+ {"group_id": group_id, "policy_name": policy_name},
2639
+ UNSET,
2640
+ None,
2641
+ options,
2642
+ ),
2643
+ )
2644
+
2645
+ async def delete_organization(
2646
+ self, organization_id: str, *, options: RequestOptions | None = None
2647
+ ) -> None:
2648
+ "Delete organization"
2649
+ return cast(
2650
+ None,
2651
+ await self._transport.request(
2652
+ "workspace",
2653
+ "https://workspace.basaltic.sh",
2654
+ _OPS["deleteOrganization"],
2655
+ "discard",
2656
+ {"organization_id": organization_id},
2657
+ UNSET,
2658
+ None,
2659
+ options,
2660
+ ),
2661
+ )
2662
+
2663
+ async def delete_policy(self, policy_id: str, *, options: RequestOptions | None = None) -> None:
2664
+ "Delete policy"
2665
+ return cast(
2666
+ None,
2667
+ await self._transport.request(
2668
+ "workspace",
2669
+ "https://workspace.basaltic.sh",
2670
+ _OPS["deletePolicy"],
2671
+ "discard",
2672
+ {"policy_id": policy_id},
2673
+ UNSET,
2674
+ None,
2675
+ options,
2676
+ ),
2677
+ )
2678
+
2679
+ async def delete_user_inline_policy(
2680
+ self, user_id: str, policy_name: str, *, options: RequestOptions | None = None
2681
+ ) -> None:
2682
+ "Delete a user's inline policy by name"
2683
+ return cast(
2684
+ None,
2685
+ await self._transport.request(
2686
+ "workspace",
2687
+ "https://workspace.basaltic.sh",
2688
+ _OPS["deleteUserInlinePolicy"],
2689
+ "discard",
2690
+ {"user_id": user_id, "policy_name": policy_name},
2691
+ UNSET,
2692
+ None,
2693
+ options,
2694
+ ),
2695
+ )
2696
+
2697
+ async def detach_group_policy(
2698
+ self, group_id: str, policy_id: str, *, options: RequestOptions | None = None
2699
+ ) -> None:
2700
+ "Detach policy from group"
2701
+ return cast(
2702
+ None,
2703
+ await self._transport.request(
2704
+ "workspace",
2705
+ "https://workspace.basaltic.sh",
2706
+ _OPS["detachGroupPolicy"],
2707
+ "discard",
2708
+ {"group_id": group_id, "policy_id": policy_id},
2709
+ UNSET,
2710
+ None,
2711
+ options,
2712
+ ),
2713
+ )
2714
+
2715
+ async def detach_role_policy(
2716
+ self, role_id: str, policy_id: str, *, options: RequestOptions | None = None
2717
+ ) -> None:
2718
+ "Detach policy from role"
2719
+ return cast(
2720
+ None,
2721
+ await self._transport.request(
2722
+ "workspace",
2723
+ "https://workspace.basaltic.sh",
2724
+ _OPS["detachRolePolicy"],
2725
+ "discard",
2726
+ {"role_id": role_id, "policy_id": policy_id},
2727
+ UNSET,
2728
+ None,
2729
+ options,
2730
+ ),
2731
+ )
2732
+
2733
+ async def detach_service_account_policy(
2734
+ self, service_account_id: str, policy_id: str, *, options: RequestOptions | None = None
2735
+ ) -> None:
2736
+ "Detach policy from service account"
2737
+ return cast(
2738
+ None,
2739
+ await self._transport.request(
2740
+ "workspace",
2741
+ "https://workspace.basaltic.sh",
2742
+ _OPS["detachServiceAccountPolicy"],
2743
+ "discard",
2744
+ {"service_account_id": service_account_id, "policy_id": policy_id},
2745
+ UNSET,
2746
+ None,
2747
+ options,
2748
+ ),
2749
+ )
2750
+
2751
+ async def detach_user_policy(
2752
+ self, user_id: str, policy_id: str, *, options: RequestOptions | None = None
2753
+ ) -> None:
2754
+ "Detach policy from user"
2755
+ return cast(
2756
+ None,
2757
+ await self._transport.request(
2758
+ "workspace",
2759
+ "https://workspace.basaltic.sh",
2760
+ _OPS["detachUserPolicy"],
2761
+ "discard",
2762
+ {"user_id": user_id, "policy_id": policy_id},
2763
+ UNSET,
2764
+ None,
2765
+ options,
2766
+ ),
2767
+ )
2768
+
2769
+ async def get_account(
2770
+ self, account_id: str, *, options: RequestOptions | None = None
2771
+ ) -> ApiResponse[m.GetAccountResponse]:
2772
+ "Get account"
2773
+ return cast(
2774
+ ApiResponse[m.GetAccountResponse],
2775
+ await self._transport.request(
2776
+ "workspace",
2777
+ "https://workspace.basaltic.sh",
2778
+ _OPS["getAccount"],
2779
+ "json",
2780
+ {"account_id": account_id},
2781
+ UNSET,
2782
+ None,
2783
+ options,
2784
+ ),
2785
+ )
2786
+
2787
+ async def get_account_by_reference(
2788
+ self,
2789
+ reference: str,
2790
+ *,
2791
+ scope: m.GetAccountScope | None = None,
2792
+ options: RequestOptions | None = None,
2793
+ ) -> ApiResponse[m.GetAccountResource]:
2794
+ return cast(
2795
+ ApiResponse[m.GetAccountResource],
2796
+ await aresolve_reference(
2797
+ reference,
2798
+ lambda id: self.get_account(id, options=options),
2799
+ lambda match: self.list_accounts(
2800
+ query=cast(
2801
+ m.ListAccountsQuery, {**reference_scope(scope), **match, "limit": 2}
2802
+ ),
2803
+ options=options,
2804
+ ),
2805
+ True,
2806
+ "account",
2807
+ ),
2808
+ )
2809
+
2810
+ async def get_account_resources(
2811
+ self, account_id: str, *, options: RequestOptions | None = None
2812
+ ) -> ApiResponse[m.GetAccountResourcesResponse]:
2813
+ "Check account resource presence"
2814
+ return cast(
2815
+ ApiResponse[m.GetAccountResourcesResponse],
2816
+ await self._transport.request(
2817
+ "workspace",
2818
+ "https://workspace.basaltic.sh",
2819
+ _OPS["getAccountResources"],
2820
+ "json",
2821
+ {"account_id": account_id},
2822
+ UNSET,
2823
+ None,
2824
+ options,
2825
+ ),
2826
+ )
2827
+
2828
+ async def get_group(
2829
+ self, group_id: str, *, options: RequestOptions | None = None
2830
+ ) -> ApiResponse[m.GetGroupResponse]:
2831
+ "Get group"
2832
+ return cast(
2833
+ ApiResponse[m.GetGroupResponse],
2834
+ await self._transport.request(
2835
+ "workspace",
2836
+ "https://workspace.basaltic.sh",
2837
+ _OPS["getGroup"],
2838
+ "json",
2839
+ {"group_id": group_id},
2840
+ UNSET,
2841
+ None,
2842
+ options,
2843
+ ),
2844
+ )
2845
+
2846
+ async def get_group_by_reference(
2847
+ self,
2848
+ reference: str,
2849
+ *,
2850
+ scope: m.GetGroupScope | None = None,
2851
+ options: RequestOptions | None = None,
2852
+ ) -> ApiResponse[m.GetGroupResource]:
2853
+ return cast(
2854
+ ApiResponse[m.GetGroupResource],
2855
+ await aresolve_reference(
2856
+ reference,
2857
+ lambda id: self.get_group(id, options=options),
2858
+ lambda match: self.list_groups(
2859
+ query=cast(m.ListGroupsQuery, {**reference_scope(scope), **match, "limit": 2}),
2860
+ options=options,
2861
+ ),
2862
+ True,
2863
+ "group",
2864
+ ),
2865
+ )
2866
+
2867
+ async def get_group_inline_policy(
2868
+ self, group_id: str, policy_name: str, *, options: RequestOptions | None = None
2869
+ ) -> ApiResponse[m.GetGroupInlinePolicyResponse]:
2870
+ "Get a group's inline policy by name"
2871
+ return cast(
2872
+ ApiResponse[m.GetGroupInlinePolicyResponse],
2873
+ await self._transport.request(
2874
+ "workspace",
2875
+ "https://workspace.basaltic.sh",
2876
+ _OPS["getGroupInlinePolicy"],
2877
+ "json",
2878
+ {"group_id": group_id, "policy_name": policy_name},
2879
+ UNSET,
2880
+ None,
2881
+ options,
2882
+ ),
2883
+ )
2884
+
2885
+ async def get_group_inline_policy_by_reference(
2886
+ self,
2887
+ group_id: str,
2888
+ reference: str,
2889
+ *,
2890
+ scope: m.GetGroupInlinePolicyScope | None = None,
2891
+ options: RequestOptions | None = None,
2892
+ ) -> ApiResponse[m.GetGroupInlinePolicyResource]:
2893
+ return cast(
2894
+ ApiResponse[m.GetGroupInlinePolicyResource],
2895
+ await aresolve_reference(
2896
+ reference,
2897
+ lambda id: self.get_group_inline_policy(group_id, id, options=options),
2898
+ lambda match: self.list_group_inline_policies(
2899
+ group_id,
2900
+ query=cast(m.ListGroupInlinePoliciesQuery, {**reference_scope(scope), **match}),
2901
+ options=options,
2902
+ ),
2903
+ True,
2904
+ "inline_policy",
2905
+ ),
2906
+ )
2907
+
2908
+ async def get_invitation(
2909
+ self, invitation_id: str, *, options: RequestOptions | None = None
2910
+ ) -> ApiResponse[m.GetInvitationResponse]:
2911
+ "Get invitation"
2912
+ return cast(
2913
+ ApiResponse[m.GetInvitationResponse],
2914
+ await self._transport.request(
2915
+ "workspace",
2916
+ "https://workspace.basaltic.sh",
2917
+ _OPS["getInvitation"],
2918
+ "json",
2919
+ {"invitation_id": invitation_id},
2920
+ UNSET,
2921
+ None,
2922
+ options,
2923
+ ),
2924
+ )
2925
+
2926
+ async def get_invitation_by_reference(
2927
+ self,
2928
+ reference: str,
2929
+ *,
2930
+ scope: m.GetInvitationScope | None = None,
2931
+ options: RequestOptions | None = None,
2932
+ ) -> ApiResponse[m.GetInvitationResource]:
2933
+ return cast(
2934
+ ApiResponse[m.GetInvitationResource],
2935
+ await aresolve_reference(
2936
+ reference,
2937
+ lambda id: self.get_invitation(id, options=options),
2938
+ lambda match: self.list_invitations(
2939
+ query=cast(
2940
+ m.ListInvitationsQuery, {**reference_scope(scope), **match, "limit": 2}
2941
+ ),
2942
+ options=options,
2943
+ ),
2944
+ True,
2945
+ "invitation",
2946
+ ),
2947
+ )
2948
+
2949
+ async def get_organization(
2950
+ self, organization_id: str, *, options: RequestOptions | None = None
2951
+ ) -> ApiResponse[m.GetOrganizationResponse]:
2952
+ "Get organization"
2953
+ return cast(
2954
+ ApiResponse[m.GetOrganizationResponse],
2955
+ await self._transport.request(
2956
+ "workspace",
2957
+ "https://workspace.basaltic.sh",
2958
+ _OPS["getOrganization"],
2959
+ "json",
2960
+ {"organization_id": organization_id},
2961
+ UNSET,
2962
+ None,
2963
+ options,
2964
+ ),
2965
+ )
2966
+
2967
+ async def get_organization_by_reference(
2968
+ self,
2969
+ reference: str,
2970
+ *,
2971
+ scope: m.GetOrganizationScope | None = None,
2972
+ options: RequestOptions | None = None,
2973
+ ) -> ApiResponse[m.GetOrganizationResource]:
2974
+ return cast(
2975
+ ApiResponse[m.GetOrganizationResource],
2976
+ await aresolve_reference(
2977
+ reference,
2978
+ lambda id: self.get_organization(id, options=options),
2979
+ lambda match: self.list_organizations(
2980
+ query=cast(
2981
+ m.ListOrganizationsQuery, {**reference_scope(scope), **match, "limit": 2}
2982
+ ),
2983
+ options=options,
2984
+ ),
2985
+ True,
2986
+ "organization",
2987
+ ),
2988
+ )
2989
+
2990
+ async def get_policy(
2991
+ self, policy_id: str, *, options: RequestOptions | None = None
2992
+ ) -> ApiResponse[m.GetPolicyResponse]:
2993
+ "Get policy"
2994
+ return cast(
2995
+ ApiResponse[m.GetPolicyResponse],
2996
+ await self._transport.request(
2997
+ "workspace",
2998
+ "https://workspace.basaltic.sh",
2999
+ _OPS["getPolicy"],
3000
+ "json",
3001
+ {"policy_id": policy_id},
3002
+ UNSET,
3003
+ None,
3004
+ options,
3005
+ ),
3006
+ )
3007
+
3008
+ async def get_policy_by_reference(
3009
+ self,
3010
+ reference: str,
3011
+ *,
3012
+ scope: m.GetPolicyScope | None = None,
3013
+ options: RequestOptions | None = None,
3014
+ ) -> ApiResponse[m.GetPolicyResource]:
3015
+ return cast(
3016
+ ApiResponse[m.GetPolicyResource],
3017
+ await aresolve_reference(
3018
+ reference,
3019
+ lambda id: self.get_policy(id, options=options),
3020
+ lambda match: self.list_policies(
3021
+ query=cast(
3022
+ m.ListPoliciesQuery, {**reference_scope(scope), **match, "limit": 2}
3023
+ ),
3024
+ options=options,
3025
+ ),
3026
+ True,
3027
+ "policy",
3028
+ ),
3029
+ )
3030
+
3031
+ async def get_user(
3032
+ self, user_id: str, *, options: RequestOptions | None = None
3033
+ ) -> ApiResponse[m.GetUserResponse]:
3034
+ "Get user"
3035
+ return cast(
3036
+ ApiResponse[m.GetUserResponse],
3037
+ await self._transport.request(
3038
+ "workspace",
3039
+ "https://workspace.basaltic.sh",
3040
+ _OPS["getUser"],
3041
+ "json",
3042
+ {"user_id": user_id},
3043
+ UNSET,
3044
+ None,
3045
+ options,
3046
+ ),
3047
+ )
3048
+
3049
+ async def get_user_by_reference(
3050
+ self,
3051
+ reference: str,
3052
+ *,
3053
+ scope: m.GetUserScope | None = None,
3054
+ options: RequestOptions | None = None,
3055
+ ) -> ApiResponse[m.GetUserResource]:
3056
+ return cast(
3057
+ ApiResponse[m.GetUserResource],
3058
+ await aresolve_reference(
3059
+ reference,
3060
+ lambda id: self.get_user(id, options=options),
3061
+ lambda match: self.list_users(
3062
+ query=cast(m.ListUsersQuery, {**reference_scope(scope), **match, "limit": 2}),
3063
+ options=options,
3064
+ ),
3065
+ True,
3066
+ "user",
3067
+ ),
3068
+ )
3069
+
3070
+ async def get_user_inline_policy(
3071
+ self, user_id: str, policy_name: str, *, options: RequestOptions | None = None
3072
+ ) -> ApiResponse[m.GetUserInlinePolicyResponse]:
3073
+ "Get a user's inline policy by name"
3074
+ return cast(
3075
+ ApiResponse[m.GetUserInlinePolicyResponse],
3076
+ await self._transport.request(
3077
+ "workspace",
3078
+ "https://workspace.basaltic.sh",
3079
+ _OPS["getUserInlinePolicy"],
3080
+ "json",
3081
+ {"user_id": user_id, "policy_name": policy_name},
3082
+ UNSET,
3083
+ None,
3084
+ options,
3085
+ ),
3086
+ )
3087
+
3088
+ async def get_user_inline_policy_by_reference(
3089
+ self,
3090
+ user_id: str,
3091
+ reference: str,
3092
+ *,
3093
+ scope: m.GetUserInlinePolicyScope | None = None,
3094
+ options: RequestOptions | None = None,
3095
+ ) -> ApiResponse[m.GetUserInlinePolicyResource]:
3096
+ return cast(
3097
+ ApiResponse[m.GetUserInlinePolicyResource],
3098
+ await aresolve_reference(
3099
+ reference,
3100
+ lambda id: self.get_user_inline_policy(user_id, id, options=options),
3101
+ lambda match: self.list_user_inline_policies(
3102
+ user_id,
3103
+ query=cast(m.ListUserInlinePoliciesQuery, {**reference_scope(scope), **match}),
3104
+ options=options,
3105
+ ),
3106
+ True,
3107
+ "inline_policy",
3108
+ ),
3109
+ )
3110
+
3111
+ async def get_user_permission_boundary(
3112
+ self, user_id: str, *, options: RequestOptions | None = None
3113
+ ) -> ApiResponse[m.GetUserPermissionBoundaryResponse]:
3114
+ "Get a user's permission boundary"
3115
+ return cast(
3116
+ ApiResponse[m.GetUserPermissionBoundaryResponse],
3117
+ await self._transport.request(
3118
+ "workspace",
3119
+ "https://workspace.basaltic.sh",
3120
+ _OPS["getUserPermissionBoundary"],
3121
+ "json",
3122
+ {"user_id": user_id},
3123
+ UNSET,
3124
+ None,
3125
+ options,
3126
+ ),
3127
+ )
3128
+
3129
+ async def list_account_role_assignments(
3130
+ self, account_id: str, *, options: RequestOptions | None = None
3131
+ ) -> Page[m.ListAccountRoleAssignmentsResponse, m.ListAccountRoleAssignmentsItem]:
3132
+ "List account role assignments"
3133
+ return cast(
3134
+ Page[m.ListAccountRoleAssignmentsResponse, m.ListAccountRoleAssignmentsItem],
3135
+ await self._transport.request(
3136
+ "workspace",
3137
+ "https://workspace.basaltic.sh",
3138
+ _OPS["listAccountRoleAssignments"],
3139
+ "page",
3140
+ {"account_id": account_id},
3141
+ UNSET,
3142
+ None,
3143
+ options,
3144
+ ),
3145
+ )
3146
+
3147
+ async def list_account_roles(
3148
+ self, *, options: RequestOptions | None = None
3149
+ ) -> Page[m.ListAccountRolesResponse, m.ListAccountRolesItem]:
3150
+ "List assigned account roles"
3151
+ return cast(
3152
+ Page[m.ListAccountRolesResponse, m.ListAccountRolesItem],
3153
+ await self._transport.request(
3154
+ "workspace",
3155
+ "https://workspace.basaltic.sh",
3156
+ _OPS["listAccountRoles"],
3157
+ "page",
3158
+ {},
3159
+ UNSET,
3160
+ None,
3161
+ options,
3162
+ ),
3163
+ )
3164
+
3165
+ async def list_accounts(
3166
+ self, *, query: m.ListAccountsQuery | None = None, options: RequestOptions | None = None
3167
+ ) -> Page[m.ListAccountsResponse, m.ListAccountsItem]:
3168
+ "List accounts"
3169
+ return cast(
3170
+ Page[m.ListAccountsResponse, m.ListAccountsItem],
3171
+ await self._transport.request(
3172
+ "workspace",
3173
+ "https://workspace.basaltic.sh",
3174
+ _OPS["listAccounts"],
3175
+ "page",
3176
+ {},
3177
+ UNSET,
3178
+ query,
3179
+ options,
3180
+ ),
3181
+ )
3182
+
3183
+ def list_accounts_all(
3184
+ self, *, query: m.ListAccountsQuery | None = None, options: RequestOptions | None = None
3185
+ ) -> AsyncIterator[m.ListAccountsItem]:
3186
+ return aiterate_pages(
3187
+ lambda marker: self.list_accounts(
3188
+ query=cast(m.ListAccountsQuery, {**(query or {}), "marker": marker}),
3189
+ options=options,
3190
+ ),
3191
+ (query or {}).get("marker", ""),
3192
+ )
3193
+
3194
+ async def list_group_inline_policies(
3195
+ self,
3196
+ group_id: str,
3197
+ *,
3198
+ query: m.ListGroupInlinePoliciesQuery | None = None,
3199
+ options: RequestOptions | None = None,
3200
+ ) -> Page[m.ListGroupInlinePoliciesResponse, m.ListGroupInlinePoliciesItem]:
3201
+ "List a group's inline policies"
3202
+ return cast(
3203
+ Page[m.ListGroupInlinePoliciesResponse, m.ListGroupInlinePoliciesItem],
3204
+ await self._transport.request(
3205
+ "workspace",
3206
+ "https://workspace.basaltic.sh",
3207
+ _OPS["listGroupInlinePolicies"],
3208
+ "page",
3209
+ {"group_id": group_id},
3210
+ UNSET,
3211
+ query,
3212
+ options,
3213
+ ),
3214
+ )
3215
+
3216
+ async def list_group_policies(
3217
+ self,
3218
+ group_id: str,
3219
+ *,
3220
+ query: m.ListGroupPoliciesQuery | None = None,
3221
+ options: RequestOptions | None = None,
3222
+ ) -> Page[m.ListGroupPoliciesResponse, m.ListGroupPoliciesItem]:
3223
+ "List group policies"
3224
+ return cast(
3225
+ Page[m.ListGroupPoliciesResponse, m.ListGroupPoliciesItem],
3226
+ await self._transport.request(
3227
+ "workspace",
3228
+ "https://workspace.basaltic.sh",
3229
+ _OPS["listGroupPolicies"],
3230
+ "page",
3231
+ {"group_id": group_id},
3232
+ UNSET,
3233
+ query,
3234
+ options,
3235
+ ),
3236
+ )
3237
+
3238
+ async def list_group_users(
3239
+ self,
3240
+ group_id: str,
3241
+ *,
3242
+ query: m.ListGroupUsersQuery | None = None,
3243
+ options: RequestOptions | None = None,
3244
+ ) -> Page[m.ListGroupUsersResponse, m.ListGroupUsersItem]:
3245
+ "List group users"
3246
+ return cast(
3247
+ Page[m.ListGroupUsersResponse, m.ListGroupUsersItem],
3248
+ await self._transport.request(
3249
+ "workspace",
3250
+ "https://workspace.basaltic.sh",
3251
+ _OPS["listGroupUsers"],
3252
+ "page",
3253
+ {"group_id": group_id},
3254
+ UNSET,
3255
+ query,
3256
+ options,
3257
+ ),
3258
+ )
3259
+
3260
+ def list_group_users_all(
3261
+ self,
3262
+ group_id: str,
3263
+ *,
3264
+ query: m.ListGroupUsersQuery | None = None,
3265
+ options: RequestOptions | None = None,
3266
+ ) -> AsyncIterator[m.ListGroupUsersItem]:
3267
+ return aiterate_pages(
3268
+ lambda marker: self.list_group_users(
3269
+ group_id,
3270
+ query=cast(m.ListGroupUsersQuery, {**(query or {}), "marker": marker}),
3271
+ options=options,
3272
+ ),
3273
+ (query or {}).get("marker", ""),
3274
+ )
3275
+
3276
+ async def list_groups(
3277
+ self, *, query: m.ListGroupsQuery | None = None, options: RequestOptions | None = None
3278
+ ) -> Page[m.ListGroupsResponse, m.ListGroupsItem]:
3279
+ "List groups"
3280
+ return cast(
3281
+ Page[m.ListGroupsResponse, m.ListGroupsItem],
3282
+ await self._transport.request(
3283
+ "workspace",
3284
+ "https://workspace.basaltic.sh",
3285
+ _OPS["listGroups"],
3286
+ "page",
3287
+ {},
3288
+ UNSET,
3289
+ query,
3290
+ options,
3291
+ ),
3292
+ )
3293
+
3294
+ def list_groups_all(
3295
+ self, *, query: m.ListGroupsQuery | None = None, options: RequestOptions | None = None
3296
+ ) -> AsyncIterator[m.ListGroupsItem]:
3297
+ return aiterate_pages(
3298
+ lambda marker: self.list_groups(
3299
+ query=cast(m.ListGroupsQuery, {**(query or {}), "marker": marker}), options=options
3300
+ ),
3301
+ (query or {}).get("marker", ""),
3302
+ )
3303
+
3304
+ async def list_invitations(
3305
+ self, *, query: m.ListInvitationsQuery | None = None, options: RequestOptions | None = None
3306
+ ) -> Page[m.ListInvitationsResponse, m.ListInvitationsItem]:
3307
+ "List invitations"
3308
+ return cast(
3309
+ Page[m.ListInvitationsResponse, m.ListInvitationsItem],
3310
+ await self._transport.request(
3311
+ "workspace",
3312
+ "https://workspace.basaltic.sh",
3313
+ _OPS["listInvitations"],
3314
+ "page",
3315
+ {},
3316
+ UNSET,
3317
+ query,
3318
+ options,
3319
+ ),
3320
+ )
3321
+
3322
+ def list_invitations_all(
3323
+ self, *, query: m.ListInvitationsQuery | None = None, options: RequestOptions | None = None
3324
+ ) -> AsyncIterator[m.ListInvitationsItem]:
3325
+ return aiterate_pages(
3326
+ lambda marker: self.list_invitations(
3327
+ query=cast(m.ListInvitationsQuery, {**(query or {}), "marker": marker}),
3328
+ options=options,
3329
+ ),
3330
+ (query or {}).get("marker", ""),
3331
+ )
3332
+
3333
+ async def list_organizations(
3334
+ self,
3335
+ *,
3336
+ query: m.ListOrganizationsQuery | None = None,
3337
+ options: RequestOptions | None = None,
3338
+ ) -> Page[m.ListOrganizationsResponse, m.ListOrganizationsItem]:
3339
+ "List organizations"
3340
+ return cast(
3341
+ Page[m.ListOrganizationsResponse, m.ListOrganizationsItem],
3342
+ await self._transport.request(
3343
+ "workspace",
3344
+ "https://workspace.basaltic.sh",
3345
+ _OPS["listOrganizations"],
3346
+ "page",
3347
+ {},
3348
+ UNSET,
3349
+ query,
3350
+ options,
3351
+ ),
3352
+ )
3353
+
3354
+ def list_organizations_all(
3355
+ self,
3356
+ *,
3357
+ query: m.ListOrganizationsQuery | None = None,
3358
+ options: RequestOptions | None = None,
3359
+ ) -> AsyncIterator[m.ListOrganizationsItem]:
3360
+ return aiterate_pages(
3361
+ lambda marker: self.list_organizations(
3362
+ query=cast(m.ListOrganizationsQuery, {**(query or {}), "marker": marker}),
3363
+ options=options,
3364
+ ),
3365
+ (query or {}).get("marker", ""),
3366
+ )
3367
+
3368
+ async def list_policies(
3369
+ self, *, query: m.ListPoliciesQuery | None = None, options: RequestOptions | None = None
3370
+ ) -> Page[m.ListPoliciesResponse, m.ListPoliciesItem]:
3371
+ "List policies"
3372
+ return cast(
3373
+ Page[m.ListPoliciesResponse, m.ListPoliciesItem],
3374
+ await self._transport.request(
3375
+ "workspace",
3376
+ "https://workspace.basaltic.sh",
3377
+ _OPS["listPolicies"],
3378
+ "page",
3379
+ {},
3380
+ UNSET,
3381
+ query,
3382
+ options,
3383
+ ),
3384
+ )
3385
+
3386
+ def list_policies_all(
3387
+ self, *, query: m.ListPoliciesQuery | None = None, options: RequestOptions | None = None
3388
+ ) -> AsyncIterator[m.ListPoliciesItem]:
3389
+ return aiterate_pages(
3390
+ lambda marker: self.list_policies(
3391
+ query=cast(m.ListPoliciesQuery, {**(query or {}), "marker": marker}),
3392
+ options=options,
3393
+ ),
3394
+ (query or {}).get("marker", ""),
3395
+ )
3396
+
3397
+ async def list_policy_groups(
3398
+ self,
3399
+ policy_id: str,
3400
+ *,
3401
+ query: m.ListPolicyGroupsQuery | None = None,
3402
+ options: RequestOptions | None = None,
3403
+ ) -> Page[m.ListPolicyGroupsResponse, m.ListPolicyGroupsItem]:
3404
+ "List groups with policy"
3405
+ return cast(
3406
+ Page[m.ListPolicyGroupsResponse, m.ListPolicyGroupsItem],
3407
+ await self._transport.request(
3408
+ "workspace",
3409
+ "https://workspace.basaltic.sh",
3410
+ _OPS["listPolicyGroups"],
3411
+ "page",
3412
+ {"policy_id": policy_id},
3413
+ UNSET,
3414
+ query,
3415
+ options,
3416
+ ),
3417
+ )
3418
+
3419
+ def list_policy_groups_all(
3420
+ self,
3421
+ policy_id: str,
3422
+ *,
3423
+ query: m.ListPolicyGroupsQuery | None = None,
3424
+ options: RequestOptions | None = None,
3425
+ ) -> AsyncIterator[m.ListPolicyGroupsItem]:
3426
+ return aiterate_pages(
3427
+ lambda marker: self.list_policy_groups(
3428
+ policy_id,
3429
+ query=cast(m.ListPolicyGroupsQuery, {**(query or {}), "marker": marker}),
3430
+ options=options,
3431
+ ),
3432
+ (query or {}).get("marker", ""),
3433
+ )
3434
+
3435
+ async def list_policy_roles(
3436
+ self,
3437
+ policy_id: str,
3438
+ *,
3439
+ query: m.ListPolicyRolesQuery | None = None,
3440
+ options: RequestOptions | None = None,
3441
+ ) -> Page[m.ListPolicyRolesResponse, m.ListPolicyRolesItem]:
3442
+ "List roles with policy"
3443
+ return cast(
3444
+ Page[m.ListPolicyRolesResponse, m.ListPolicyRolesItem],
3445
+ await self._transport.request(
3446
+ "workspace",
3447
+ "https://workspace.basaltic.sh",
3448
+ _OPS["listPolicyRoles"],
3449
+ "page",
3450
+ {"policy_id": policy_id},
3451
+ UNSET,
3452
+ query,
3453
+ options,
3454
+ ),
3455
+ )
3456
+
3457
+ def list_policy_roles_all(
3458
+ self,
3459
+ policy_id: str,
3460
+ *,
3461
+ query: m.ListPolicyRolesQuery | None = None,
3462
+ options: RequestOptions | None = None,
3463
+ ) -> AsyncIterator[m.ListPolicyRolesItem]:
3464
+ return aiterate_pages(
3465
+ lambda marker: self.list_policy_roles(
3466
+ policy_id,
3467
+ query=cast(m.ListPolicyRolesQuery, {**(query or {}), "marker": marker}),
3468
+ options=options,
3469
+ ),
3470
+ (query or {}).get("marker", ""),
3471
+ )
3472
+
3473
+ async def list_policy_service_accounts(
3474
+ self,
3475
+ policy_id: str,
3476
+ *,
3477
+ query: m.ListPolicyServiceAccountsQuery | None = None,
3478
+ options: RequestOptions | None = None,
3479
+ ) -> Page[m.ListPolicyServiceAccountsResponse, m.ListPolicyServiceAccountsItem]:
3480
+ "List service accounts with policy"
3481
+ return cast(
3482
+ Page[m.ListPolicyServiceAccountsResponse, m.ListPolicyServiceAccountsItem],
3483
+ await self._transport.request(
3484
+ "workspace",
3485
+ "https://workspace.basaltic.sh",
3486
+ _OPS["listPolicyServiceAccounts"],
3487
+ "page",
3488
+ {"policy_id": policy_id},
3489
+ UNSET,
3490
+ query,
3491
+ options,
3492
+ ),
3493
+ )
3494
+
3495
+ def list_policy_service_accounts_all(
3496
+ self,
3497
+ policy_id: str,
3498
+ *,
3499
+ query: m.ListPolicyServiceAccountsQuery | None = None,
3500
+ options: RequestOptions | None = None,
3501
+ ) -> AsyncIterator[m.ListPolicyServiceAccountsItem]:
3502
+ return aiterate_pages(
3503
+ lambda marker: self.list_policy_service_accounts(
3504
+ policy_id,
3505
+ query=cast(m.ListPolicyServiceAccountsQuery, {**(query or {}), "marker": marker}),
3506
+ options=options,
3507
+ ),
3508
+ (query or {}).get("marker", ""),
3509
+ )
3510
+
3511
+ async def list_policy_users(
3512
+ self,
3513
+ policy_id: str,
3514
+ *,
3515
+ query: m.ListPolicyUsersQuery | None = None,
3516
+ options: RequestOptions | None = None,
3517
+ ) -> Page[m.ListPolicyUsersResponse, m.ListPolicyUsersItem]:
3518
+ "List users with policy"
3519
+ return cast(
3520
+ Page[m.ListPolicyUsersResponse, m.ListPolicyUsersItem],
3521
+ await self._transport.request(
3522
+ "workspace",
3523
+ "https://workspace.basaltic.sh",
3524
+ _OPS["listPolicyUsers"],
3525
+ "page",
3526
+ {"policy_id": policy_id},
3527
+ UNSET,
3528
+ query,
3529
+ options,
3530
+ ),
3531
+ )
3532
+
3533
+ def list_policy_users_all(
3534
+ self,
3535
+ policy_id: str,
3536
+ *,
3537
+ query: m.ListPolicyUsersQuery | None = None,
3538
+ options: RequestOptions | None = None,
3539
+ ) -> AsyncIterator[m.ListPolicyUsersItem]:
3540
+ return aiterate_pages(
3541
+ lambda marker: self.list_policy_users(
3542
+ policy_id,
3543
+ query=cast(m.ListPolicyUsersQuery, {**(query or {}), "marker": marker}),
3544
+ options=options,
3545
+ ),
3546
+ (query or {}).get("marker", ""),
3547
+ )
3548
+
3549
+ async def list_role_policies(
3550
+ self,
3551
+ role_id: str,
3552
+ *,
3553
+ query: m.ListRolePoliciesQuery | None = None,
3554
+ options: RequestOptions | None = None,
3555
+ ) -> Page[m.ListRolePoliciesResponse, m.ListRolePoliciesItem]:
3556
+ "List role policies"
3557
+ return cast(
3558
+ Page[m.ListRolePoliciesResponse, m.ListRolePoliciesItem],
3559
+ await self._transport.request(
3560
+ "workspace",
3561
+ "https://workspace.basaltic.sh",
3562
+ _OPS["listRolePolicies"],
3563
+ "page",
3564
+ {"role_id": role_id},
3565
+ UNSET,
3566
+ query,
3567
+ options,
3568
+ ),
3569
+ )
3570
+
3571
+ async def list_service_account_policies(
3572
+ self,
3573
+ service_account_id: str,
3574
+ *,
3575
+ query: m.ListServiceAccountPoliciesQuery | None = None,
3576
+ options: RequestOptions | None = None,
3577
+ ) -> Page[m.ListServiceAccountPoliciesResponse, m.ListServiceAccountPoliciesItem]:
3578
+ "List service account policies"
3579
+ return cast(
3580
+ Page[m.ListServiceAccountPoliciesResponse, m.ListServiceAccountPoliciesItem],
3581
+ await self._transport.request(
3582
+ "workspace",
3583
+ "https://workspace.basaltic.sh",
3584
+ _OPS["listServiceAccountPolicies"],
3585
+ "page",
3586
+ {"service_account_id": service_account_id},
3587
+ UNSET,
3588
+ query,
3589
+ options,
3590
+ ),
3591
+ )
3592
+
3593
+ async def list_user_groups(
3594
+ self,
3595
+ user_id: str,
3596
+ *,
3597
+ query: m.ListUserGroupsQuery | None = None,
3598
+ options: RequestOptions | None = None,
3599
+ ) -> Page[m.ListUserGroupsResponse, m.ListUserGroupsItem]:
3600
+ "List user groups"
3601
+ return cast(
3602
+ Page[m.ListUserGroupsResponse, m.ListUserGroupsItem],
3603
+ await self._transport.request(
3604
+ "workspace",
3605
+ "https://workspace.basaltic.sh",
3606
+ _OPS["listUserGroups"],
3607
+ "page",
3608
+ {"user_id": user_id},
3609
+ UNSET,
3610
+ query,
3611
+ options,
3612
+ ),
3613
+ )
3614
+
3615
+ async def list_user_inline_policies(
3616
+ self,
3617
+ user_id: str,
3618
+ *,
3619
+ query: m.ListUserInlinePoliciesQuery | None = None,
3620
+ options: RequestOptions | None = None,
3621
+ ) -> Page[m.ListUserInlinePoliciesResponse, m.ListUserInlinePoliciesItem]:
3622
+ "List a user's inline policies"
3623
+ return cast(
3624
+ Page[m.ListUserInlinePoliciesResponse, m.ListUserInlinePoliciesItem],
3625
+ await self._transport.request(
3626
+ "workspace",
3627
+ "https://workspace.basaltic.sh",
3628
+ _OPS["listUserInlinePolicies"],
3629
+ "page",
3630
+ {"user_id": user_id},
3631
+ UNSET,
3632
+ query,
3633
+ options,
3634
+ ),
3635
+ )
3636
+
3637
+ async def list_user_policies(
3638
+ self,
3639
+ user_id: str,
3640
+ *,
3641
+ query: m.ListUserPoliciesQuery | None = None,
3642
+ options: RequestOptions | None = None,
3643
+ ) -> Page[m.ListUserPoliciesResponse, m.ListUserPoliciesItem]:
3644
+ "List user policies"
3645
+ return cast(
3646
+ Page[m.ListUserPoliciesResponse, m.ListUserPoliciesItem],
3647
+ await self._transport.request(
3648
+ "workspace",
3649
+ "https://workspace.basaltic.sh",
3650
+ _OPS["listUserPolicies"],
3651
+ "page",
3652
+ {"user_id": user_id},
3653
+ UNSET,
3654
+ query,
3655
+ options,
3656
+ ),
3657
+ )
3658
+
3659
+ async def list_users(
3660
+ self, *, query: m.ListUsersQuery | None = None, options: RequestOptions | None = None
3661
+ ) -> Page[m.ListUsersResponse, m.ListUsersItem]:
3662
+ "List users"
3663
+ return cast(
3664
+ Page[m.ListUsersResponse, m.ListUsersItem],
3665
+ await self._transport.request(
3666
+ "workspace",
3667
+ "https://workspace.basaltic.sh",
3668
+ _OPS["listUsers"],
3669
+ "page",
3670
+ {},
3671
+ UNSET,
3672
+ query,
3673
+ options,
3674
+ ),
3675
+ )
3676
+
3677
+ def list_users_all(
3678
+ self, *, query: m.ListUsersQuery | None = None, options: RequestOptions | None = None
3679
+ ) -> AsyncIterator[m.ListUsersItem]:
3680
+ return aiterate_pages(
3681
+ lambda marker: self.list_users(
3682
+ query=cast(m.ListUsersQuery, {**(query or {}), "marker": marker}), options=options
3683
+ ),
3684
+ (query or {}).get("marker", ""),
3685
+ )
3686
+
3687
+ async def put_group_inline_policy(
3688
+ self,
3689
+ group_id: str,
3690
+ policy_name: str,
3691
+ body: m.PutGroupInlinePolicyBody,
3692
+ *,
3693
+ options: RequestOptions | None = None,
3694
+ ) -> ApiResponse[m.PutGroupInlinePolicyResponse]:
3695
+ "Create or replace a group's inline policy"
3696
+ return cast(
3697
+ ApiResponse[m.PutGroupInlinePolicyResponse],
3698
+ await self._transport.request(
3699
+ "workspace",
3700
+ "https://workspace.basaltic.sh",
3701
+ _OPS["putGroupInlinePolicy"],
3702
+ "json",
3703
+ {"group_id": group_id, "policy_name": policy_name},
3704
+ body,
3705
+ None,
3706
+ options,
3707
+ ),
3708
+ )
3709
+
3710
+ async def put_user_inline_policy(
3711
+ self,
3712
+ user_id: str,
3713
+ policy_name: str,
3714
+ body: m.PutUserInlinePolicyBody,
3715
+ *,
3716
+ options: RequestOptions | None = None,
3717
+ ) -> ApiResponse[m.PutUserInlinePolicyResponse]:
3718
+ "Create or replace a user's inline policy"
3719
+ return cast(
3720
+ ApiResponse[m.PutUserInlinePolicyResponse],
3721
+ await self._transport.request(
3722
+ "workspace",
3723
+ "https://workspace.basaltic.sh",
3724
+ _OPS["putUserInlinePolicy"],
3725
+ "json",
3726
+ {"user_id": user_id, "policy_name": policy_name},
3727
+ body,
3728
+ None,
3729
+ options,
3730
+ ),
3731
+ )
3732
+
3733
+ async def remove_account_role_assignment(
3734
+ self, account_id: str, assignment_id: str, *, options: RequestOptions | None = None
3735
+ ) -> None:
3736
+ "Remove account role assignment"
3737
+ return cast(
3738
+ None,
3739
+ await self._transport.request(
3740
+ "workspace",
3741
+ "https://workspace.basaltic.sh",
3742
+ _OPS["removeAccountRoleAssignment"],
3743
+ "discard",
3744
+ {"account_id": account_id, "assignment_id": assignment_id},
3745
+ UNSET,
3746
+ None,
3747
+ options,
3748
+ ),
3749
+ )
3750
+
3751
+ async def remove_user(self, user_id: str, *, options: RequestOptions | None = None) -> None:
3752
+ "Remove user from organization"
3753
+ return cast(
3754
+ None,
3755
+ await self._transport.request(
3756
+ "workspace",
3757
+ "https://workspace.basaltic.sh",
3758
+ _OPS["removeUser"],
3759
+ "discard",
3760
+ {"user_id": user_id},
3761
+ UNSET,
3762
+ None,
3763
+ options,
3764
+ ),
3765
+ )
3766
+
3767
+ async def remove_user_from_group(
3768
+ self, user_id: str, group_id: str, *, options: RequestOptions | None = None
3769
+ ) -> None:
3770
+ "Remove user from group"
3771
+ return cast(
3772
+ None,
3773
+ await self._transport.request(
3774
+ "workspace",
3775
+ "https://workspace.basaltic.sh",
3776
+ _OPS["removeUserFromGroup"],
3777
+ "discard",
3778
+ {"user_id": user_id, "group_id": group_id},
3779
+ UNSET,
3780
+ None,
3781
+ options,
3782
+ ),
3783
+ )
3784
+
3785
+ async def remove_user_permission_boundary(
3786
+ self, user_id: str, *, options: RequestOptions | None = None
3787
+ ) -> None:
3788
+ "Remove a user's permission boundary"
3789
+ return cast(
3790
+ None,
3791
+ await self._transport.request(
3792
+ "workspace",
3793
+ "https://workspace.basaltic.sh",
3794
+ _OPS["removeUserPermissionBoundary"],
3795
+ "discard",
3796
+ {"user_id": user_id},
3797
+ UNSET,
3798
+ None,
3799
+ options,
3800
+ ),
3801
+ )
3802
+
3803
+ async def set_user_permission_boundary(
3804
+ self,
3805
+ user_id: str,
3806
+ body: m.SetUserPermissionBoundaryBody,
3807
+ *,
3808
+ options: RequestOptions | None = None,
3809
+ ) -> None:
3810
+ "Set a user's permission boundary"
3811
+ return cast(
3812
+ None,
3813
+ await self._transport.request(
3814
+ "workspace",
3815
+ "https://workspace.basaltic.sh",
3816
+ _OPS["setUserPermissionBoundary"],
3817
+ "discard",
3818
+ {"user_id": user_id},
3819
+ body,
3820
+ None,
3821
+ options,
3822
+ ),
3823
+ )
3824
+
3825
+ async def update_account(
3826
+ self, account_id: str, body: m.UpdateAccountBody, *, options: RequestOptions | None = None
3827
+ ) -> ApiResponse[m.UpdateAccountResponse]:
3828
+ "Update account"
3829
+ return cast(
3830
+ ApiResponse[m.UpdateAccountResponse],
3831
+ await self._transport.request(
3832
+ "workspace",
3833
+ "https://workspace.basaltic.sh",
3834
+ _OPS["updateAccount"],
3835
+ "json",
3836
+ {"account_id": account_id},
3837
+ body,
3838
+ None,
3839
+ options,
3840
+ ),
3841
+ )
3842
+
3843
+ async def update_group(
3844
+ self, group_id: str, body: m.UpdateGroupBody, *, options: RequestOptions | None = None
3845
+ ) -> ApiResponse[m.UpdateGroupResponse]:
3846
+ "Update group"
3847
+ return cast(
3848
+ ApiResponse[m.UpdateGroupResponse],
3849
+ await self._transport.request(
3850
+ "workspace",
3851
+ "https://workspace.basaltic.sh",
3852
+ _OPS["updateGroup"],
3853
+ "json",
3854
+ {"group_id": group_id},
3855
+ body,
3856
+ None,
3857
+ options,
3858
+ ),
3859
+ )
3860
+
3861
+ async def update_organization(
3862
+ self,
3863
+ organization_id: str,
3864
+ body: m.UpdateOrganizationBody,
3865
+ *,
3866
+ options: RequestOptions | None = None,
3867
+ ) -> ApiResponse[m.UpdateOrganizationResponse]:
3868
+ "Update organization"
3869
+ return cast(
3870
+ ApiResponse[m.UpdateOrganizationResponse],
3871
+ await self._transport.request(
3872
+ "workspace",
3873
+ "https://workspace.basaltic.sh",
3874
+ _OPS["updateOrganization"],
3875
+ "json",
3876
+ {"organization_id": organization_id},
3877
+ body,
3878
+ None,
3879
+ options,
3880
+ ),
3881
+ )
3882
+
3883
+ async def update_policy(
3884
+ self, policy_id: str, body: m.UpdatePolicyBody, *, options: RequestOptions | None = None
3885
+ ) -> ApiResponse[m.UpdatePolicyResponse]:
3886
+ "Update policy"
3887
+ return cast(
3888
+ ApiResponse[m.UpdatePolicyResponse],
3889
+ await self._transport.request(
3890
+ "workspace",
3891
+ "https://workspace.basaltic.sh",
3892
+ _OPS["updatePolicy"],
3893
+ "json",
3894
+ {"policy_id": policy_id},
3895
+ body,
3896
+ None,
3897
+ options,
3898
+ ),
3899
+ )