Skip to content

Latest commit

 

History

History
executable file
·
6462 lines (5431 loc) · 248 KB

File metadata and controls

executable file
·
6462 lines (5431 loc) · 248 KB
 
Oct 13, 2022
Oct 13, 2022
1
# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
2
Dec 1, 2023
Dec 1, 2023
3
from __future__ import annotations
4
Mar 1, 2023
Mar 1, 2023
5
import logging
Oct 13, 2022
Oct 13, 2022
6
from dataclasses import dataclass
7
from enum import Enum
Jul 12, 2023
Jul 12, 2023
8
from typing import Any, Dict, Iterator, List, Optional
Oct 13, 2022
Oct 13, 2022
9
Oct 14, 2025
Oct 14, 2025
10
from databricks.sdk.service._internal import (_enum, _from_dict,
11
_repeated_dict, _repeated_enum)
Mar 22, 2023
Mar 22, 2023
12
Feb 27, 2025
Feb 27, 2025
13
_LOG = logging.getLogger("databricks.sdk")
Dec 17, 2022
Dec 17, 2022
14
Mar 5, 2025
Mar 5, 2025
15
Oct 13, 2022
Oct 13, 2022
16
# all definitions in this file are in alphabetical order
17
Dec 12, 2022
Dec 12, 2022
18
Apr 20, 2023
Apr 20, 2023
19
@dataclass
20
class AccessControlRequest:
Jun 15, 2023
Jun 15, 2023
21
group_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
22
"""name of the group"""
23
24
permission_level: Optional[PermissionLevel] = None
25
Jun 15, 2023
Jun 15, 2023
26
service_principal_name: Optional[str] = None
Jan 23, 2024
Jan 23, 2024
27
"""application ID of a service principal"""
Dec 1, 2023
Dec 1, 2023
28
Jun 15, 2023
Jun 15, 2023
29
user_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
30
"""name of the user"""
Apr 20, 2023
Apr 20, 2023
31
32
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
33
"""Serializes the AccessControlRequest into a dictionary suitable for use as a JSON request body."""
Apr 20, 2023
Apr 20, 2023
34
body = {}
Feb 27, 2025
Feb 27, 2025
35
if self.group_name is not None:
36
body["group_name"] = self.group_name
37
if self.permission_level is not None:
38
body["permission_level"] = self.permission_level.value
Jun 2, 2023
Jun 2, 2023
39
if self.service_principal_name is not None:
Feb 27, 2025
Feb 27, 2025
40
body["service_principal_name"] = self.service_principal_name
41
if self.user_name is not None:
42
body["user_name"] = self.user_name
Apr 20, 2023
Apr 20, 2023
43
return body
44
Dec 10, 2024
Dec 10, 2024
45
def as_shallow_dict(self) -> dict:
46
"""Serializes the AccessControlRequest into a shallow dictionary of its immediate attributes."""
47
body = {}
Feb 27, 2025
Feb 27, 2025
48
if self.group_name is not None:
49
body["group_name"] = self.group_name
50
if self.permission_level is not None:
51
body["permission_level"] = self.permission_level
Dec 10, 2024
Dec 10, 2024
52
if self.service_principal_name is not None:
Feb 27, 2025
Feb 27, 2025
53
body["service_principal_name"] = self.service_principal_name
54
if self.user_name is not None:
55
body["user_name"] = self.user_name
Dec 10, 2024
Dec 10, 2024
56
return body
57
Apr 20, 2023
Apr 20, 2023
58
@classmethod
Mar 5, 2025
Mar 5, 2025
59
def from_dict(cls, d: Dict[str, Any]) -> AccessControlRequest:
Dec 1, 2023
Dec 1, 2023
60
"""Deserializes the AccessControlRequest from a dictionary."""
Feb 27, 2025
Feb 27, 2025
61
return cls(
62
group_name=d.get("group_name", None),
63
permission_level=_enum(d, "permission_level", PermissionLevel),
64
service_principal_name=d.get("service_principal_name", None),
65
user_name=d.get("user_name", None),
66
)
Apr 20, 2023
Apr 20, 2023
67
68
69
@dataclass
70
class AccessControlResponse:
Dec 1, 2023
Dec 1, 2023
71
all_permissions: Optional[List[Permission]] = None
72
"""All permissions."""
73
Aug 7, 2023
Aug 7, 2023
74
display_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
75
"""Display name of the user or service principal."""
76
Jun 15, 2023
Jun 15, 2023
77
group_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
78
"""name of the group"""
79
Jun 15, 2023
Jun 15, 2023
80
service_principal_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
81
"""Name of the service principal."""
82
Jun 15, 2023
Jun 15, 2023
83
user_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
84
"""name of the user"""
Apr 20, 2023
Apr 20, 2023
85
86
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
87
"""Serializes the AccessControlResponse into a dictionary suitable for use as a JSON request body."""
Apr 20, 2023
Apr 20, 2023
88
body = {}
Feb 27, 2025
Feb 27, 2025
89
if self.all_permissions:
90
body["all_permissions"] = [v.as_dict() for v in self.all_permissions]
91
if self.display_name is not None:
92
body["display_name"] = self.display_name
93
if self.group_name is not None:
94
body["group_name"] = self.group_name
Jun 2, 2023
Jun 2, 2023
95
if self.service_principal_name is not None:
Feb 27, 2025
Feb 27, 2025
96
body["service_principal_name"] = self.service_principal_name
97
if self.user_name is not None:
98
body["user_name"] = self.user_name
Apr 20, 2023
Apr 20, 2023
99
return body
100
Dec 10, 2024
Dec 10, 2024
101
def as_shallow_dict(self) -> dict:
102
"""Serializes the AccessControlResponse into a shallow dictionary of its immediate attributes."""
103
body = {}
Feb 27, 2025
Feb 27, 2025
104
if self.all_permissions:
105
body["all_permissions"] = self.all_permissions
106
if self.display_name is not None:
107
body["display_name"] = self.display_name
108
if self.group_name is not None:
109
body["group_name"] = self.group_name
Dec 10, 2024
Dec 10, 2024
110
if self.service_principal_name is not None:
Feb 27, 2025
Feb 27, 2025
111
body["service_principal_name"] = self.service_principal_name
112
if self.user_name is not None:
113
body["user_name"] = self.user_name
Dec 10, 2024
Dec 10, 2024
114
return body
115
Apr 20, 2023
Apr 20, 2023
116
@classmethod
Mar 5, 2025
Mar 5, 2025
117
def from_dict(cls, d: Dict[str, Any]) -> AccessControlResponse:
Dec 1, 2023
Dec 1, 2023
118
"""Deserializes the AccessControlResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
119
return cls(
120
all_permissions=_repeated_dict(d, "all_permissions", Permission),
121
display_name=d.get("display_name", None),
122
group_name=d.get("group_name", None),
123
service_principal_name=d.get("service_principal_name", None),
124
user_name=d.get("user_name", None),
125
)
Apr 20, 2023
Apr 20, 2023
126
127
Sep 18, 2025
Sep 18, 2025
128
@dataclass
129
class AccountGroup:
130
account_id: Optional[str] = None
131
"""Databricks account ID"""
132
133
display_name: Optional[str] = None
134
"""String that represents a human-readable group name"""
135
136
external_id: Optional[str] = None
137
"""external_id should be unique for identifying groups"""
138
139
id: Optional[str] = None
140
"""Databricks group ID"""
141
142
members: Optional[List[ComplexValue]] = None
143
144
meta: Optional[ResourceMeta] = None
145
"""Container for the group identifier. Workspace local versus account."""
146
147
roles: Optional[List[ComplexValue]] = None
148
"""Indicates if the group has the admin role."""
149
150
def as_dict(self) -> dict:
151
"""Serializes the AccountGroup into a dictionary suitable for use as a JSON request body."""
152
body = {}
153
if self.account_id is not None:
154
body["account_id"] = self.account_id
155
if self.display_name is not None:
156
body["displayName"] = self.display_name
157
if self.external_id is not None:
158
body["externalId"] = self.external_id
159
if self.id is not None:
160
body["id"] = self.id
161
if self.members:
162
body["members"] = [v.as_dict() for v in self.members]
163
if self.meta:
164
body["meta"] = self.meta.as_dict()
165
if self.roles:
166
body["roles"] = [v.as_dict() for v in self.roles]
167
return body
168
169
def as_shallow_dict(self) -> dict:
170
"""Serializes the AccountGroup into a shallow dictionary of its immediate attributes."""
171
body = {}
172
if self.account_id is not None:
173
body["account_id"] = self.account_id
174
if self.display_name is not None:
175
body["displayName"] = self.display_name
176
if self.external_id is not None:
177
body["externalId"] = self.external_id
178
if self.id is not None:
179
body["id"] = self.id
180
if self.members:
181
body["members"] = self.members
182
if self.meta:
183
body["meta"] = self.meta
184
if self.roles:
185
body["roles"] = self.roles
186
return body
187
188
@classmethod
189
def from_dict(cls, d: Dict[str, Any]) -> AccountGroup:
190
"""Deserializes the AccountGroup from a dictionary."""
191
return cls(
192
account_id=d.get("account_id", None),
193
display_name=d.get("displayName", None),
194
external_id=d.get("externalId", None),
195
id=d.get("id", None),
196
members=_repeated_dict(d, "members", ComplexValue),
197
meta=_from_dict(d, "meta", ResourceMeta),
198
roles=_repeated_dict(d, "roles", ComplexValue),
199
)
200
201
202
@dataclass
203
class AccountServicePrincipal:
204
account_id: Optional[str] = None
205
"""Databricks account ID"""
206
207
active: Optional[bool] = None
208
"""If this user is active"""
209
210
application_id: Optional[str] = None
211
"""UUID relating to the service principal"""
212
213
display_name: Optional[str] = None
214
"""String that represents a concatenation of given and family names."""
215
216
external_id: Optional[str] = None
217
218
id: Optional[str] = None
219
"""Databricks service principal ID."""
220
221
roles: Optional[List[ComplexValue]] = None
222
"""Indicates if the group has the admin role."""
223
224
def as_dict(self) -> dict:
225
"""Serializes the AccountServicePrincipal into a dictionary suitable for use as a JSON request body."""
226
body = {}
227
if self.account_id is not None:
228
body["account_id"] = self.account_id
229
if self.active is not None:
230
body["active"] = self.active
231
if self.application_id is not None:
232
body["applicationId"] = self.application_id
233
if self.display_name is not None:
234
body["displayName"] = self.display_name
235
if self.external_id is not None:
236
body["externalId"] = self.external_id
237
if self.id is not None:
238
body["id"] = self.id
239
if self.roles:
240
body["roles"] = [v.as_dict() for v in self.roles]
241
return body
242
243
def as_shallow_dict(self) -> dict:
244
"""Serializes the AccountServicePrincipal into a shallow dictionary of its immediate attributes."""
245
body = {}
246
if self.account_id is not None:
247
body["account_id"] = self.account_id
248
if self.active is not None:
249
body["active"] = self.active
250
if self.application_id is not None:
251
body["applicationId"] = self.application_id
252
if self.display_name is not None:
253
body["displayName"] = self.display_name
254
if self.external_id is not None:
255
body["externalId"] = self.external_id
256
if self.id is not None:
257
body["id"] = self.id
258
if self.roles:
259
body["roles"] = self.roles
260
return body
261
262
@classmethod
263
def from_dict(cls, d: Dict[str, Any]) -> AccountServicePrincipal:
264
"""Deserializes the AccountServicePrincipal from a dictionary."""
265
return cls(
266
account_id=d.get("account_id", None),
267
active=d.get("active", None),
268
application_id=d.get("applicationId", None),
269
display_name=d.get("displayName", None),
270
external_id=d.get("externalId", None),
271
id=d.get("id", None),
272
roles=_repeated_dict(d, "roles", ComplexValue),
273
)
274
275
276
@dataclass
277
class AccountUser:
278
account_id: Optional[str] = None
279
"""Databricks account ID"""
280
281
active: Optional[bool] = None
282
"""If this user is active"""
283
284
display_name: Optional[str] = None
285
"""String that represents a concatenation of given and family names. For example `John Smith`."""
286
287
emails: Optional[List[ComplexValue]] = None
288
"""All the emails associated with the Databricks user."""
289
290
external_id: Optional[str] = None
291
"""External ID is not currently supported. It is reserved for future use."""
292
293
id: Optional[str] = None
294
"""Databricks user ID."""
295
296
name: Optional[Name] = None
297
298
roles: Optional[List[ComplexValue]] = None
299
"""Indicates if the group has the admin role."""
300
301
user_name: Optional[str] = None
302
"""Email address of the Databricks user."""
303
304
def as_dict(self) -> dict:
305
"""Serializes the AccountUser into a dictionary suitable for use as a JSON request body."""
306
body = {}
307
if self.account_id is not None:
308
body["account_id"] = self.account_id
309
if self.active is not None:
310
body["active"] = self.active
311
if self.display_name is not None:
312
body["displayName"] = self.display_name
313
if self.emails:
314
body["emails"] = [v.as_dict() for v in self.emails]
315
if self.external_id is not None:
316
body["externalId"] = self.external_id
317
if self.id is not None:
318
body["id"] = self.id
319
if self.name:
320
body["name"] = self.name.as_dict()
321
if self.roles:
322
body["roles"] = [v.as_dict() for v in self.roles]
323
if self.user_name is not None:
324
body["userName"] = self.user_name
325
return body
326
327
def as_shallow_dict(self) -> dict:
328
"""Serializes the AccountUser into a shallow dictionary of its immediate attributes."""
329
body = {}
330
if self.account_id is not None:
331
body["account_id"] = self.account_id
332
if self.active is not None:
333
body["active"] = self.active
334
if self.display_name is not None:
335
body["displayName"] = self.display_name
336
if self.emails:
337
body["emails"] = self.emails
338
if self.external_id is not None:
339
body["externalId"] = self.external_id
340
if self.id is not None:
341
body["id"] = self.id
342
if self.name:
343
body["name"] = self.name
344
if self.roles:
345
body["roles"] = self.roles
346
if self.user_name is not None:
347
body["userName"] = self.user_name
348
return body
349
350
@classmethod
351
def from_dict(cls, d: Dict[str, Any]) -> AccountUser:
352
"""Deserializes the AccountUser from a dictionary."""
353
return cls(
354
account_id=d.get("account_id", None),
355
active=d.get("active", None),
356
display_name=d.get("displayName", None),
357
emails=_repeated_dict(d, "emails", ComplexValue),
358
external_id=d.get("externalId", None),
359
id=d.get("id", None),
360
name=_from_dict(d, "name", Name),
361
roles=_repeated_dict(d, "roles", ComplexValue),
362
user_name=d.get("userName", None),
363
)
364
365
Jan 20, 2025
Jan 20, 2025
366
@dataclass
367
class Actor:
368
"""represents an identity trying to access a resource - user or a service principal group can be a
Mar 5, 2025
Mar 5, 2025
369
principal of a permission set assignment but an actor is always a user or a service principal"""
Jan 20, 2025
Jan 20, 2025
370
371
actor_id: Optional[int] = None
372
373
def as_dict(self) -> dict:
374
"""Serializes the Actor into a dictionary suitable for use as a JSON request body."""
375
body = {}
Feb 27, 2025
Feb 27, 2025
376
if self.actor_id is not None:
377
body["actor_id"] = self.actor_id
Jan 20, 2025
Jan 20, 2025
378
return body
379
380
def as_shallow_dict(self) -> dict:
381
"""Serializes the Actor into a shallow dictionary of its immediate attributes."""
382
body = {}
Feb 27, 2025
Feb 27, 2025
383
if self.actor_id is not None:
384
body["actor_id"] = self.actor_id
Jan 20, 2025
Jan 20, 2025
385
return body
386
387
@classmethod
Mar 5, 2025
Mar 5, 2025
388
def from_dict(cls, d: Dict[str, Any]) -> Actor:
Jan 20, 2025
Jan 20, 2025
389
"""Deserializes the Actor from a dictionary."""
Feb 27, 2025
Feb 27, 2025
390
return cls(actor_id=d.get("actor_id", None))
Jan 20, 2025
Jan 20, 2025
391
392
393
@dataclass
394
class CheckPolicyResponse:
395
consistency_token: ConsistencyToken
396
397
is_permitted: Optional[bool] = None
398
399
def as_dict(self) -> dict:
400
"""Serializes the CheckPolicyResponse into a dictionary suitable for use as a JSON request body."""
401
body = {}
Feb 27, 2025
Feb 27, 2025
402
if self.consistency_token:
403
body["consistency_token"] = self.consistency_token.as_dict()
404
if self.is_permitted is not None:
405
body["is_permitted"] = self.is_permitted
Jan 20, 2025
Jan 20, 2025
406
return body
407
408
def as_shallow_dict(self) -> dict:
409
"""Serializes the CheckPolicyResponse into a shallow dictionary of its immediate attributes."""
410
body = {}
Feb 27, 2025
Feb 27, 2025
411
if self.consistency_token:
412
body["consistency_token"] = self.consistency_token
413
if self.is_permitted is not None:
414
body["is_permitted"] = self.is_permitted
Jan 20, 2025
Jan 20, 2025
415
return body
416
417
@classmethod
Mar 5, 2025
Mar 5, 2025
418
def from_dict(cls, d: Dict[str, Any]) -> CheckPolicyResponse:
Jan 20, 2025
Jan 20, 2025
419
"""Deserializes the CheckPolicyResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
420
return cls(
421
consistency_token=_from_dict(d, "consistency_token", ConsistencyToken),
422
is_permitted=d.get("is_permitted", None),
423
)
Jan 20, 2025
Jan 20, 2025
424
425
Oct 13, 2022
Oct 13, 2022
426
@dataclass
427
class ComplexValue:
Jun 15, 2023
Jun 15, 2023
428
display: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
429
Jun 15, 2023
Jun 15, 2023
430
primary: Optional[bool] = None
Dec 1, 2023
Dec 1, 2023
431
Feb 19, 2024
Feb 19, 2024
432
ref: Optional[str] = None
433
Jun 15, 2023
Jun 15, 2023
434
type: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
435
Jun 15, 2023
Jun 15, 2023
436
value: Optional[str] = None
Oct 13, 2022
Oct 13, 2022
437
Dec 17, 2022
Dec 17, 2022
438
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
439
"""Serializes the ComplexValue into a dictionary suitable for use as a JSON request body."""
Dec 17, 2022
Dec 17, 2022
440
body = {}
Feb 27, 2025
Feb 27, 2025
441
if self.display is not None:
442
body["display"] = self.display
443
if self.primary is not None:
444
body["primary"] = self.primary
445
if self.ref is not None:
446
body["$ref"] = self.ref
447
if self.type is not None:
448
body["type"] = self.type
449
if self.value is not None:
450
body["value"] = self.value
Dec 17, 2022
Dec 17, 2022
451
return body
Oct 13, 2022
Oct 13, 2022
452
Dec 10, 2024
Dec 10, 2024
453
def as_shallow_dict(self) -> dict:
454
"""Serializes the ComplexValue into a shallow dictionary of its immediate attributes."""
455
body = {}
Feb 27, 2025
Feb 27, 2025
456
if self.display is not None:
457
body["display"] = self.display
458
if self.primary is not None:
459
body["primary"] = self.primary
460
if self.ref is not None:
461
body["$ref"] = self.ref
462
if self.type is not None:
463
body["type"] = self.type
464
if self.value is not None:
465
body["value"] = self.value
Dec 10, 2024
Dec 10, 2024
466
return body
467
Oct 13, 2022
Oct 13, 2022
468
@classmethod
Mar 5, 2025
Mar 5, 2025
469
def from_dict(cls, d: Dict[str, Any]) -> ComplexValue:
Dec 1, 2023
Dec 1, 2023
470
"""Deserializes the ComplexValue from a dictionary."""
Feb 27, 2025
Feb 27, 2025
471
return cls(
472
display=d.get("display", None),
473
primary=d.get("primary", None),
474
ref=d.get("$ref", None),
475
type=d.get("type", None),
476
value=d.get("value", None),
477
)
Oct 13, 2022
Oct 13, 2022
478
479
Jan 20, 2025
Jan 20, 2025
480
@dataclass
481
class ConsistencyToken:
482
value: str
483
484
def as_dict(self) -> dict:
485
"""Serializes the ConsistencyToken into a dictionary suitable for use as a JSON request body."""
486
body = {}
Feb 27, 2025
Feb 27, 2025
487
if self.value is not None:
488
body["value"] = self.value
Jan 20, 2025
Jan 20, 2025
489
return body
490
491
def as_shallow_dict(self) -> dict:
492
"""Serializes the ConsistencyToken into a shallow dictionary of its immediate attributes."""
493
body = {}
Feb 27, 2025
Feb 27, 2025
494
if self.value is not None:
495
body["value"] = self.value
Jan 20, 2025
Jan 20, 2025
496
return body
497
498
@classmethod
Mar 5, 2025
Mar 5, 2025
499
def from_dict(cls, d: Dict[str, Any]) -> ConsistencyToken:
Jan 20, 2025
Jan 20, 2025
500
"""Deserializes the ConsistencyToken from a dictionary."""
Feb 27, 2025
Feb 27, 2025
501
return cls(value=d.get("value", None))
Jan 20, 2025
Jan 20, 2025
502
503
Feb 23, 2024
Feb 23, 2024
504
@dataclass
Jul 22, 2024
Jul 22, 2024
505
class DeleteWorkspacePermissionAssignmentResponse:
Feb 23, 2024
Feb 23, 2024
506
def as_dict(self) -> dict:
Jul 22, 2024
Jul 22, 2024
507
"""Serializes the DeleteWorkspacePermissionAssignmentResponse into a dictionary suitable for use as a JSON request body."""
Feb 23, 2024
Feb 23, 2024
508
body = {}
509
return body
510
Dec 10, 2024
Dec 10, 2024
511
def as_shallow_dict(self) -> dict:
512
"""Serializes the DeleteWorkspacePermissionAssignmentResponse into a shallow dictionary of its immediate attributes."""
513
body = {}
514
return body
515
Feb 23, 2024
Feb 23, 2024
516
@classmethod
Mar 5, 2025
Mar 5, 2025
517
def from_dict(cls, d: Dict[str, Any]) -> DeleteWorkspacePermissionAssignmentResponse:
Jul 22, 2024
Jul 22, 2024
518
"""Deserializes the DeleteWorkspacePermissionAssignmentResponse from a dictionary."""
Feb 23, 2024
Feb 23, 2024
519
return cls()
520
521
Jun 2, 2023
Jun 2, 2023
522
@dataclass
523
class GetAssignableRolesForResourceResponse:
Dec 1, 2023
Dec 1, 2023
524
roles: Optional[List[Role]] = None
Jun 2, 2023
Jun 2, 2023
525
526
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
527
"""Serializes the GetAssignableRolesForResourceResponse into a dictionary suitable for use as a JSON request body."""
Jun 2, 2023
Jun 2, 2023
528
body = {}
Feb 27, 2025
Feb 27, 2025
529
if self.roles:
530
body["roles"] = [v.as_dict() for v in self.roles]
Jun 2, 2023
Jun 2, 2023
531
return body
532
Dec 10, 2024
Dec 10, 2024
533
def as_shallow_dict(self) -> dict:
534
"""Serializes the GetAssignableRolesForResourceResponse into a shallow dictionary of its immediate attributes."""
535
body = {}
Feb 27, 2025
Feb 27, 2025
536
if self.roles:
537
body["roles"] = self.roles
Dec 10, 2024
Dec 10, 2024
538
return body
539
Jun 2, 2023
Jun 2, 2023
540
@classmethod
Mar 5, 2025
Mar 5, 2025
541
def from_dict(cls, d: Dict[str, Any]) -> GetAssignableRolesForResourceResponse:
Dec 1, 2023
Dec 1, 2023
542
"""Deserializes the GetAssignableRolesForResourceResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
543
return cls(roles=_repeated_dict(d, "roles", Role))
Aug 7, 2023
Aug 7, 2023
544
545
546
@dataclass
547
class GetPasswordPermissionLevelsResponse:
Dec 1, 2023
Dec 1, 2023
548
permission_levels: Optional[List[PasswordPermissionsDescription]] = None
549
"""Specific permission levels"""
Aug 7, 2023
Aug 7, 2023
550
551
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
552
"""Serializes the GetPasswordPermissionLevelsResponse into a dictionary suitable for use as a JSON request body."""
Aug 7, 2023
Aug 7, 2023
553
body = {}
Feb 27, 2025
Feb 27, 2025
554
if self.permission_levels:
555
body["permission_levels"] = [v.as_dict() for v in self.permission_levels]
Aug 7, 2023
Aug 7, 2023
556
return body
557
Dec 10, 2024
Dec 10, 2024
558
def as_shallow_dict(self) -> dict:
559
"""Serializes the GetPasswordPermissionLevelsResponse into a shallow dictionary of its immediate attributes."""
560
body = {}
Feb 27, 2025
Feb 27, 2025
561
if self.permission_levels:
562
body["permission_levels"] = self.permission_levels
Dec 10, 2024
Dec 10, 2024
563
return body
564
Aug 7, 2023
Aug 7, 2023
565
@classmethod
Mar 5, 2025
Mar 5, 2025
566
def from_dict(cls, d: Dict[str, Any]) -> GetPasswordPermissionLevelsResponse:
Dec 1, 2023
Dec 1, 2023
567
"""Deserializes the GetPasswordPermissionLevelsResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
568
return cls(permission_levels=_repeated_dict(d, "permission_levels", PasswordPermissionsDescription))
Jun 2, 2023
Jun 2, 2023
569
570
Apr 20, 2023
Apr 20, 2023
571
@dataclass
572
class GetPermissionLevelsResponse:
Dec 1, 2023
Dec 1, 2023
573
permission_levels: Optional[List[PermissionsDescription]] = None
574
"""Specific permission levels"""
Apr 20, 2023
Apr 20, 2023
575
576
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
577
"""Serializes the GetPermissionLevelsResponse into a dictionary suitable for use as a JSON request body."""
Apr 20, 2023
Apr 20, 2023
578
body = {}
Feb 27, 2025
Feb 27, 2025
579
if self.permission_levels:
580
body["permission_levels"] = [v.as_dict() for v in self.permission_levels]
Apr 20, 2023
Apr 20, 2023
581
return body
582
Dec 10, 2024
Dec 10, 2024
583
def as_shallow_dict(self) -> dict:
584
"""Serializes the GetPermissionLevelsResponse into a shallow dictionary of its immediate attributes."""
585
body = {}
Feb 27, 2025
Feb 27, 2025
586
if self.permission_levels:
587
body["permission_levels"] = self.permission_levels
Dec 10, 2024
Dec 10, 2024
588
return body
589
Apr 20, 2023
Apr 20, 2023
590
@classmethod
Mar 5, 2025
Mar 5, 2025
591
def from_dict(cls, d: Dict[str, Any]) -> GetPermissionLevelsResponse:
Dec 1, 2023
Dec 1, 2023
592
"""Deserializes the GetPermissionLevelsResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
593
return cls(permission_levels=_repeated_dict(d, "permission_levels", PermissionsDescription))
Apr 20, 2023
Apr 20, 2023
594
595
Oct 24, 2023
Oct 24, 2023
596
class GetSortOrder(Enum):
597
Feb 27, 2025
Feb 27, 2025
598
ASCENDING = "ascending"
599
DESCENDING = "descending"
Oct 24, 2023
Oct 24, 2023
600
601
Jun 2, 2023
Jun 2, 2023
602
@dataclass
603
class GrantRule:
604
role: str
Dec 1, 2023
Dec 1, 2023
605
"""Role that is assigned to the list of principals."""
606
607
principals: Optional[List[str]] = None
May 22, 2025
May 22, 2025
608
"""Principals this grant rule applies to. A principal can be a user (for end users), a service
609
principal (for applications and compute workloads), or an account group. Each principal has its
610
own identifier format: * users/<USERNAME> * groups/<GROUP_NAME> *
611
servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>"""
Jun 2, 2023
Jun 2, 2023
612
613
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
614
"""Serializes the GrantRule into a dictionary suitable for use as a JSON request body."""
Jun 2, 2023
Jun 2, 2023
615
body = {}
Feb 27, 2025
Feb 27, 2025
616
if self.principals:
617
body["principals"] = [v for v in self.principals]
618
if self.role is not None:
619
body["role"] = self.role
Jun 2, 2023
Jun 2, 2023
620
return body
621
Dec 10, 2024
Dec 10, 2024
622
def as_shallow_dict(self) -> dict:
623
"""Serializes the GrantRule into a shallow dictionary of its immediate attributes."""
624
body = {}
Feb 27, 2025
Feb 27, 2025
625
if self.principals:
626
body["principals"] = self.principals
627
if self.role is not None:
628
body["role"] = self.role
Dec 10, 2024
Dec 10, 2024
629
return body
630
Jun 2, 2023
Jun 2, 2023
631
@classmethod
Mar 5, 2025
Mar 5, 2025
632
def from_dict(cls, d: Dict[str, Any]) -> GrantRule:
Dec 1, 2023
Dec 1, 2023
633
"""Deserializes the GrantRule from a dictionary."""
Feb 27, 2025
Feb 27, 2025
634
return cls(principals=d.get("principals", None), role=d.get("role", None))
Jun 2, 2023
Jun 2, 2023
635
636
Oct 13, 2022
Oct 13, 2022
637
@dataclass
638
class Group:
Jun 15, 2023
Jun 15, 2023
639
display_name: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
640
"""String that represents a human-readable group name"""
641
642
entitlements: Optional[List[ComplexValue]] = None
643
"""Entitlements assigned to the group. See [assigning entitlements] for a full list of supported
644
values.
645
646
[assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements"""
647
Jun 15, 2023
Jun 15, 2023
648
external_id: Optional[str] = None
Sep 18, 2025
Sep 18, 2025
649
"""external_id should be unique for identifying groups"""
Dec 1, 2023
Dec 1, 2023
650
651
groups: Optional[List[ComplexValue]] = None
652
Jun 15, 2023
Jun 15, 2023
653
id: Optional[str] = None
Dec 1, 2023
Dec 1, 2023
654
"""Databricks group ID"""
655
656
members: Optional[List[ComplexValue]] = None
657
658
meta: Optional[ResourceMeta] = None
659
"""Container for the group identifier. Workspace local versus account."""
660
661
roles: Optional[List[ComplexValue]] = None
662
"""Corresponds to AWS instance profile/arn role."""
663
664
schemas: Optional[List[GroupSchema]] = None
665
"""The schema of the group."""
Oct 13, 2022
Oct 13, 2022
666
Dec 17, 2022
Dec 17, 2022
667
def as_dict(self) -> dict:
Dec 1, 2023
Dec 1, 2023
668
"""Serializes the Group into a dictionary suitable for use as a JSON request body."""
Dec 17, 2022
Dec 17, 2022
669
body = {}
Feb 27, 2025
Feb 27, 2025
670
if self.display_name is not None:
671
body["displayName"] = self.display_name
672
if self.entitlements:
673
body["entitlements"] = [v.as_dict() for v in self.entitlements]
674
if self.external_id is not None:
675
body["externalId"] = self.external_id
676
if self.groups:
677
body["groups"] = [v.as_dict() for v in self.groups]
678
if self.id is not None:
679
body["id"] = self.id
680
if self.members:
681
body["members"] = [v.as_dict() for v in self.members]
682
if self.meta:
683
body["meta"] = self.meta.as_dict()
684
if self.roles:
685
body["roles"] = [v.as_dict() for v in self.roles]
686
if self.schemas:
687
body["schemas"] = [v.value for v in self.schemas]
Dec 17, 2022
Dec 17, 2022
688
return body
Oct 13, 2022
Oct 13, 2022
689
Dec 10, 2024
Dec 10, 2024
690
def as_shallow_dict(self) -> dict:
691
"""Serializes the Group into a shallow dictionary of its immediate attributes."""
692
body = {}
Feb 27, 2025
Feb 27, 2025
693
if self.display_name is not None:
694
body["displayName"] = self.display_name
695
if self.entitlements:
696
body["entitlements"] = self.entitlements
697
if self.external_id is not None:
698
body["externalId"] = self.external_id
699
if self.groups:
700
body["groups"] = self.groups
701
if self.id is not None:
702
body["id"] = self.id
703
if self.members:
704
body["members"] = self.members
705
if self.meta:
706
body["meta"] = self.meta
707
if self.roles:
708
body["roles"] = self.roles
709
if self.schemas:
710
body["schemas"] = self.schemas
Dec 10, 2024
Dec 10, 2024
711
return body
712
Oct 13, 2022
Oct 13, 2022
713
@classmethod
Mar 5, 2025
Mar 5, 2025
714
def from_dict(cls, d: Dict[str, Any]) -> Group:
Dec 1, 2023
Dec 1, 2023
715
"""Deserializes the Group from a dictionary."""
Feb 27, 2025
Feb 27, 2025
716
return cls(
717
display_name=d.get("displayName", None),
718
entitlements=_repeated_dict(d, "entitlements", ComplexValue),
719
external_id=d.get("externalId", None),
720
groups=_repeated_dict(d, "groups", ComplexValue),
721
id=d.get("id", None),
722
members=_repeated_dict(d, "members", ComplexValue),
723
meta=_from_dict(d, "meta", ResourceMeta),
724
roles=_repeated_dict(d, "roles", ComplexValue),
725
schemas=_repeated_enum(d, "schemas", GroupSchema),
726
)
Oct 24, 2023
Oct 24, 2023
727
728
729
class GroupSchema(Enum):
730
Feb 27, 2025
Feb 27, 2025
731
URN_IETF_PARAMS_SCIM_SCHEMAS_CORE_2_0_GROUP = "urn:ietf:params:scim:schemas:core:2.0:Group"
Oct 13, 2022
Oct 13, 2022
732
733
734
@dataclass
Sep 18, 2025
Sep 18, 2025
735
class ListAccountGroupsResponse:
Jun 15, 2023
Jun 15, 2023
736
items_per_page: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
737
"""Total results returned in the response."""
738
Sep 18, 2025
Sep 18, 2025
739
resources: Optional[List[AccountGroup]] = None
Dec 1, 2023
Dec 1, 2023
740
"""User objects returned in the response."""
741
Jun 15, 2023
Jun 15, 2023
742
start_index: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
743
"""Starting index of all the results that matched the request filters. First item is number 1."""
744
Jun 15, 2023
Jun 15, 2023
745
total_results: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
746
"""Total results that match the request filters."""
Dec 17, 2022
Dec 17, 2022
747
748
def as_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
749
"""Serializes the ListAccountGroupsResponse into a dictionary suitable for use as a JSON request body."""
Dec 17, 2022
Dec 17, 2022
750
body = {}
Feb 27, 2025
Feb 27, 2025
751
if self.items_per_page is not None:
752
body["itemsPerPage"] = self.items_per_page
753
if self.resources:
754
body["Resources"] = [v.as_dict() for v in self.resources]
755
if self.start_index is not None:
756
body["startIndex"] = self.start_index
757
if self.total_results is not None:
758
body["totalResults"] = self.total_results
Dec 17, 2022
Dec 17, 2022
759
return body
Oct 13, 2022
Oct 13, 2022
760
Dec 10, 2024
Dec 10, 2024
761
def as_shallow_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
762
"""Serializes the ListAccountGroupsResponse into a shallow dictionary of its immediate attributes."""
Dec 10, 2024
Dec 10, 2024
763
body = {}
Feb 27, 2025
Feb 27, 2025
764
if self.items_per_page is not None:
765
body["itemsPerPage"] = self.items_per_page
766
if self.resources:
767
body["Resources"] = self.resources
768
if self.start_index is not None:
769
body["startIndex"] = self.start_index
770
if self.total_results is not None:
771
body["totalResults"] = self.total_results
Dec 10, 2024
Dec 10, 2024
772
return body
773
Oct 13, 2022
Oct 13, 2022
774
@classmethod
Sep 18, 2025
Sep 18, 2025
775
def from_dict(cls, d: Dict[str, Any]) -> ListAccountGroupsResponse:
776
"""Deserializes the ListAccountGroupsResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
777
return cls(
778
items_per_page=d.get("itemsPerPage", None),
Sep 18, 2025
Sep 18, 2025
779
resources=_repeated_dict(d, "Resources", AccountGroup),
Feb 27, 2025
Feb 27, 2025
780
start_index=d.get("startIndex", None),
781
total_results=d.get("totalResults", None),
782
)
Oct 13, 2022
Oct 13, 2022
783
784
785
@dataclass
Sep 18, 2025
Sep 18, 2025
786
class ListAccountServicePrincipalsResponse:
Jun 15, 2023
Jun 15, 2023
787
items_per_page: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
788
"""Total results returned in the response."""
789
Sep 18, 2025
Sep 18, 2025
790
resources: Optional[List[AccountServicePrincipal]] = None
Dec 1, 2023
Dec 1, 2023
791
"""User objects returned in the response."""
792
Jun 15, 2023
Jun 15, 2023
793
start_index: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
794
"""Starting index of all the results that matched the request filters. First item is number 1."""
795
Jun 15, 2023
Jun 15, 2023
796
total_results: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
797
"""Total results that match the request filters."""
Dec 17, 2022
Dec 17, 2022
798
799
def as_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
800
"""Serializes the ListAccountServicePrincipalsResponse into a dictionary suitable for use as a JSON request body."""
Dec 17, 2022
Dec 17, 2022
801
body = {}
Feb 27, 2025
Feb 27, 2025
802
if self.items_per_page is not None:
803
body["itemsPerPage"] = self.items_per_page
804
if self.resources:
805
body["Resources"] = [v.as_dict() for v in self.resources]
806
if self.start_index is not None:
807
body["startIndex"] = self.start_index
808
if self.total_results is not None:
809
body["totalResults"] = self.total_results
Dec 17, 2022
Dec 17, 2022
810
return body
Oct 13, 2022
Oct 13, 2022
811
Dec 10, 2024
Dec 10, 2024
812
def as_shallow_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
813
"""Serializes the ListAccountServicePrincipalsResponse into a shallow dictionary of its immediate attributes."""
Dec 10, 2024
Dec 10, 2024
814
body = {}
Feb 27, 2025
Feb 27, 2025
815
if self.items_per_page is not None:
816
body["itemsPerPage"] = self.items_per_page
817
if self.resources:
818
body["Resources"] = self.resources
819
if self.start_index is not None:
820
body["startIndex"] = self.start_index
821
if self.total_results is not None:
822
body["totalResults"] = self.total_results
Dec 10, 2024
Dec 10, 2024
823
return body
824
Oct 13, 2022
Oct 13, 2022
825
@classmethod
Sep 18, 2025
Sep 18, 2025
826
def from_dict(cls, d: Dict[str, Any]) -> ListAccountServicePrincipalsResponse:
827
"""Deserializes the ListAccountServicePrincipalsResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
828
return cls(
829
items_per_page=d.get("itemsPerPage", None),
Sep 18, 2025
Sep 18, 2025
830
resources=_repeated_dict(d, "Resources", AccountServicePrincipal),
Feb 27, 2025
Feb 27, 2025
831
start_index=d.get("startIndex", None),
832
total_results=d.get("totalResults", None),
833
)
Oct 13, 2022
Oct 13, 2022
834
835
836
@dataclass
Sep 18, 2025
Sep 18, 2025
837
class ListAccountUsersResponse:
Jun 15, 2023
Jun 15, 2023
838
items_per_page: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
839
"""Total results returned in the response."""
840
Sep 18, 2025
Sep 18, 2025
841
resources: Optional[List[AccountUser]] = None
Dec 1, 2023
Dec 1, 2023
842
"""User objects returned in the response."""
843
Jun 15, 2023
Jun 15, 2023
844
start_index: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
845
"""Starting index of all the results that matched the request filters. First item is number 1."""
846
Jun 15, 2023
Jun 15, 2023
847
total_results: Optional[int] = None
Dec 1, 2023
Dec 1, 2023
848
"""Total results that match the request filters."""
Dec 17, 2022
Dec 17, 2022
849
850
def as_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
851
"""Serializes the ListAccountUsersResponse into a dictionary suitable for use as a JSON request body."""
Dec 17, 2022
Dec 17, 2022
852
body = {}
Feb 27, 2025
Feb 27, 2025
853
if self.items_per_page is not None:
854
body["itemsPerPage"] = self.items_per_page
855
if self.resources:
856
body["Resources"] = [v.as_dict() for v in self.resources]
857
if self.start_index is not None:
858
body["startIndex"] = self.start_index
859
if self.total_results is not None:
860
body["totalResults"] = self.total_results
Dec 17, 2022
Dec 17, 2022
861
return body
Oct 13, 2022
Oct 13, 2022
862
Dec 10, 2024
Dec 10, 2024
863
def as_shallow_dict(self) -> dict:
Sep 18, 2025
Sep 18, 2025
864
"""Serializes the ListAccountUsersResponse into a shallow dictionary of its immediate attributes."""
Dec 10, 2024
Dec 10, 2024
865
body = {}
Feb 27, 2025
Feb 27, 2025
866
if self.items_per_page is not None:
867
body["itemsPerPage"] = self.items_per_page
868
if self.resources:
869
body["Resources"] = self.resources
870
if self.start_index is not None:
871
body["startIndex"] = self.start_index
872
if self.total_results is not None:
873
body["totalResults"] = self.total_results
Dec 10, 2024
Dec 10, 2024
874
return body
875
Oct 13, 2022
Oct 13, 2022
876
@classmethod
Sep 18, 2025
Sep 18, 2025
877
def from_dict(cls, d: Dict[str, Any]) -> ListAccountUsersResponse:
878
"""Deserializes the ListAccountUsersResponse from a dictionary."""
Feb 27, 2025
Feb 27, 2025
879
return cls(
880
items_per_page=d.get("itemsPerPage", None),
Sep 18, 2025
Sep 18, 2025
881
resources=_repeated_dict(d, "Resources", AccountUser),
Feb 27, 2025
Feb 27, 2025
882
start_index=d.get("startIndex", None),
883
total_results=d.get("totalResults", None),
884
)
Oct 13, 2022
Oct 13, 2022
885
886
Jul 22, 2024
Jul 22, 2024
887
@dataclass
Sep 18, 2025
Sep 18, 2025
888
class ListGroupsResponse:
889
items_per_page: Optional[int] = None
890
"""Total results returned in the response."""
891
892
resources: Optional[List[Group]] = None
893
"""User objects returned in the response."""
894
895
schemas: Optional[List[ListResponseSchema]] = None
896
"""The schema of the service principal."""
897
898
start_index: Optional[int] = None
899
"""Starting index of all the results that matched the request filters. First item is number 1."""
900
901
total_results: Optional[int] = None
902
"""Total results that match the request filters."""
903
904
def as_dict(self) -> dict:
905
"""Serializes the ListGroupsResponse into a dictionary suitable for use as a JSON request body."""
906
body = {}
907
if self.items_per_page is not None:
908
body["itemsPerPage"] = self.items_per_page
909
if self.resources:
910
body["Resources"] = [v.as_dict() for v in self.resources]
911
if self.schemas:
912
body["schemas"] = [v.value for v in self.schemas]
913
if self.start_index is not None:
914
body["startIndex"] = self.start_index
915
if self.total_results is not None:
916
body["totalResults"] = self.total_results
917
return body
918
919
def as_shallow_dict(self) -> dict:
920
"""Serializes the ListGroupsResponse into a shallow dictionary of its immediate attributes."""
921
body = {}
922
if self.items_per_page is not None:
923
body["itemsPerPage"] = self.items_per_page
924
if self.resources:
925
body["Resources"] = self.resources
926
if self.schemas:
927
body["schemas"] = self.schemas
928
if self.start_index is not None:
929
body["startIndex"] = self.start_index
930
if self.total_results is not None:
931
body["totalResults"] = self.total_results
932
return body
933
934
@classmethod
935
def from_dict(cls, d: Dict[str, Any]) -> ListGroupsResponse:
936
"""Deserializes the ListGroupsResponse from a dictionary."""
937
return cls(
938
items_per_page=d.get("itemsPerPage", None),
939
resources=_repeated_dict(d, "Resources", Group),
940
schemas=_repeated_enum(d, "schemas", ListResponseSchema),
941
start_index=d.get("startIndex", None),
942
total_results=d.get("totalResults", None),
943
)
944
945
946
class ListResponseSchema(Enum):
947
948
URN_IETF_PARAMS_SCIM_API_MESSAGES_2_0_LIST_RESPONSE = "urn:ietf:params:scim:api:messages:2.0:ListResponse"
949
950
951
@dataclass
952
class ListServicePrincipalResponse:
953
items_per_page: Optional[int] = None
954
"""Total results returned in the response."""
955
956
resources: Optional[List[ServicePrincipal]] = None
957
"""User objects returned in the response."""
958
959
schemas: Optional[List[ListResponseSchema]] = None
960
"""The schema of the List response."""
961
962
start_index: Optional[int] = None
963
"""Starting index of all the results that matched the request filters. First item is number 1."""
964
965
total_results: Optional[int] = None
966
"""Total results that match the request filters."""
967
968
def as_dict(self) -> dict:
969
"""Serializes the ListServicePrincipalResponse into a dictionary suitable for use as a JSON request body."""
970
body = {}
971
if self.items_per_page is not None:
972
body["itemsPerPage"] = self.items_per_page
973
if self.resources:
974
body["Resources"] = [v.as_dict() for v in self.resources]
975
if self.schemas:
976
body["schemas"] = [v.value for v in self.schemas]
977
if self.start_index is not None:
978
body["startIndex"] = self.start_index
979
if self.total_results is not None:
980
body["totalResults"] = self.total_results
981
return body
982
983
def as_shallow_dict(self) -> dict:
984
"""Serializes the ListServicePrincipalResponse into a shallow dictionary of its immediate attributes."""
985
body = {}
986
if self.items_per_page is not None:
987
body["itemsPerPage"] = self.items_per_page
988
if self.resources:
989
body["Resources"] = self.resources
990
if self.schemas:
991
body["schemas"] = self.schemas
992
if self.start_index is not None:
993
body["startIndex"] = self.start_index
994
if self.total_results is not None:
995
body["totalResults"] = self.total_results
996
return body
997
998
@classmethod
999
def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalResponse:
1000
"""Deserializes the ListServicePrincipalResponse from a dictionary."""