account_default
account_default ¶
DomoAccount_Default
dataclass
¶
DomoAccount_Default(
auth: DomoAuth,
id: int,
raw: dict,
name: str = None,
display_name: str = None,
data_provider_type: str = None,
created_dt: datetime = None,
modified_dt: datetime = None,
owners: list[Any] = None,
is_admin_summary: bool = True,
dataset_count: int = None,
Config: DomoAccount_Config = None,
)
Bases: DomoEntity
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict[str, Any],
is_admin_summary: bool = True,
new_cls: Any = None,
**kwargs
)
converts data_v1_accounts API response into an accounts class object
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
account_id: int,
is_suppress_no_config: bool = True,
session: AsyncClient = None,
return_raw: bool = False,
debug_api: bool = False,
debug_num_stacks_to_drop=2,
is_use_default_account_class=False,
is_unmask=True,
*,
context: RouteContext | None = None,
**context_kwargs
)
retrieves account metadata and attempts to retrieve config
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
get_entity_by_id
async
classmethod
¶
get_entity_by_id(entity_id, **kwargs)
Alias for get_by_id
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
327 328 329 330 | |
refresh
async
¶
refresh(
auth: DomoAuth = None,
is_suppress_no_config: bool = True,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoAccount_Default
Reload entity properties from the API and refresh the account Config.
Thin wrapper that chains
super().refresh()— callsget_entity_by_id(i.e.get_by_id) to reload all entity-level attributes (name, data_provider_type, owners, etc.)._get_config()— fetches and parses the account credential config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Auth to use for config retrieval (defaults to |
None
|
is_suppress_no_config
|
bool
|
Suppress errors when no |
True
|
debug_api
|
bool
|
Enable API debug logging. |
False
|
session
|
AsyncClient | None
|
Optional reusable |
None
|
context
|
RouteContext | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
DomoAccount_Default
|
Self, mutated in-place with refreshed data. |
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
share
async
¶
share(
user_id: int | None = None,
group_id: int | None = None,
access_level: (
AccountAccess | AccountAccess_v1 | str | None
) = None,
session: AsyncClient | None = None,
debug_api: bool = False,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
Share this account with a user or group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int | None
|
User ID to share with (mutually exclusive with group_id) |
None
|
group_id
|
int | None
|
Group ID to share with (mutually exclusive with user_id) |
None
|
access_level
|
AccountAccess | AccountAccess_v1 | str | None
|
Access level (AccessLevel enum) |
None
|
session
|
AsyncClient | None
|
HTTP client session (optional) |
None
|
debug_api
|
bool
|
Enable API debugging |
False
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
ResponseGetData if return_raw=True, else the updated account |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither user_id nor group_id is provided |
Account_Share_Error
|
If sharing operation fails |
Example
from crew_dcs.routes.account import AccountAccess account = await DomoAccount.get_by_id(auth=auth, account_id="123") await account.share( ... user_id=456, ... access_level=AccountAccess.CAN_EDIT ... )
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |
upsert_target_account
async
¶
upsert_target_account(
target_auth: DomoAuth,
account_name: str | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
upsert an account in a target instance with self.Config
Source code in src/crew_dcs/classes/DomoAccount/account_default.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |