account_oauth
account_oauth ¶
AccountNoMatchError ¶
AccountNoMatchError(
account_id: str | None = None,
res=None,
message: str = "Account not found -- has it been shared with the user?",
**kwargs
)
Bases: RouteError
Raised when a specific account cannot be found or accessed.
Source code in src/crew_dcs/routes/account/exceptions.py
96 97 98 99 100 101 102 103 | |
Account_CRUD_Error ¶
Account_CRUD_Error(
operation: str = "CRUD",
account_id: str | None = None,
res=None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when account create, update, or delete operations fail.
Source code in src/crew_dcs/routes/account/exceptions.py
49 50 51 52 53 54 55 56 57 58 59 | |
Account_Config_Error ¶
Account_Config_Error(
account_id: str | None = None,
res=None,
message: str | None = None,
**kwargs
)
Bases: RouteError
Raised when account configuration operations fail.
Source code in src/crew_dcs/routes/account/exceptions.py
81 82 83 84 85 86 87 88 89 90 | |
Account_GET_Error ¶
Account_GET_Error(
account_id: str | None = None, res=None, **kwargs
)
Bases: RouteError
Raised when account retrieval operations fail.
Source code in src/crew_dcs/routes/account/exceptions.py
24 25 26 27 28 29 30 | |
DomoAccount_OAuth
dataclass
¶
DomoAccount_OAuth(
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: DomoAccount_Default
create
async
classmethod
¶
create(
auth: DomoAuth,
account_name: str,
oauth_config: OAuthConfig,
origin: str = "OAUTH_CONFIGURATION",
debug_api: bool = False,
session: AsyncClient = None,
debug_num_stacks_to_drop=2,
*,
context: RouteContext | None = None,
**context_kwargs
)
Create a new OAuth account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
account_name
|
str
|
Display name for the OAuth account |
required |
oauth_config
|
OAuthConfig
|
OAuth configuration object (OAuthConfig enum member) |
required |
origin
|
str
|
Origin type for the OAuth account (default: "OAUTH_CONFIGURATION") |
'OAUTH_CONFIGURATION'
|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient
|
HTTP client session (optional) |
None
|
debug_num_stacks_to_drop
|
Stack frames to drop for debugging |
2
|
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
DomoAccount_OAuth instance with configuration loaded |
Raises:
| Type | Description |
|---|---|
Account_CRUD_Error
|
If account creation fails |
Source code in src/crew_dcs/classes/DomoAccount/account_oauth.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
delete
async
¶
delete(
debug_api: bool = False,
debug_num_stacks_to_drop=2,
session: AsyncClient = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Delete this OAuth account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug_api
|
bool
|
Enable API debugging |
False
|
debug_num_stacks_to_drop
|
Stack frames to drop for debugging |
2
|
|
session
|
AsyncClient
|
HTTP client session (optional) |
None
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
ResponseGetData object confirming deletion |
Raises:
| Type | Description |
|---|---|
Account_CRUD_Error
|
If account deletion fails |
Source code in src/crew_dcs/classes/DomoAccount/account_oauth.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
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,
*,
context: RouteContext | None = None,
**context_kwargs
)
Retrieve OAuth account metadata and attempt to retrieve configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
account_id
|
int
|
ID of the OAuth account to retrieve |
required |
is_suppress_no_config
|
bool
|
Suppress errors when config is not defined |
True
|
session
|
AsyncClient
|
HTTP client session (optional) |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
debug_api
|
bool
|
Enable API debugging |
False
|
debug_num_stacks_to_drop
|
Stack frames to drop for debugging |
2
|
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
DomoAccount_OAuth |
OAuth account instance with configuration |
Raises:
| Type | Description |
|---|---|
AccountNoMatchError
|
If OAuth account is not found |
Account_GET_Error
|
If OAuth account retrieval fails |
Account_Config_Error
|
If configuration retrieval fails |
Source code in src/crew_dcs/classes/DomoAccount/account_oauth.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
share
async
¶
share(
user_id: int | None = None,
group_id: int | None = None,
access_level: AccountAccess | str | None = None,
session: AsyncClient | None = None,
debug_api: bool = False,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
Share this OAuth 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 | str | None
|
Access level (ShareAccount_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_OAuth.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_oauth.py
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | |
update_config
async
¶
update_config(
oauth_config: OAuthConfig = None,
debug_api: bool = False,
debug_num_stacks_to_drop=2,
session: AsyncClient = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Update the configuration of this OAuth account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oauth_config
|
OAuthConfig
|
New OAuth configuration (defaults to current config if None) |
None
|
debug_api
|
bool
|
Enable API debugging |
False
|
debug_num_stacks_to_drop
|
Stack frames to drop for debugging |
2
|
|
session
|
AsyncClient
|
HTTP client session (optional) |
None
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
Self (DomoAccount_OAuth) with updated configuration |
Raises:
| Type | Description |
|---|---|
Account_Config_Error
|
If configuration update fails |
Source code in src/crew_dcs/classes/DomoAccount/account_oauth.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
update_name
async
¶
update_name(
account_name: str,
debug_api: bool = False,
debug_num_stacks_to_drop: int = 2,
session: AsyncClient = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Update the name of this OAuth account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_name
|
str
|
New display name for the account |
required |
debug_api
|
bool
|
Enable API debugging |
False
|
debug_num_stacks_to_drop
|
int
|
Stack frames to drop for debugging |
2
|
session
|
AsyncClient
|
HTTP client session (optional) |
None
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
Self (DomoAccount_OAuth) with updated name |
Raises:
| Type | Description |
|---|---|
Account_CRUD_Error
|
If name update fails |
Source code in src/crew_dcs/classes/DomoAccount/account_oauth.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |