base
base ¶
Domo entity system.
This package provides foundational classes for all Domo entities with support for authentication, relationships, lineage tracking, and entity management.
Modules: - base: Foundational classes and enhanced enums - entities: Core Domo entity classes and managers
The design provides a consistent interface across all Domo entity types while supporting advanced features like lineage tracking and relationships.
Access ¶
DomoBase
dataclass
¶
DomoBase()
Bases: ABC
Abstract base class for all Domo objects.
This class serves as the foundation for all Domo entities and managers, providing a common interface and ensuring consistent implementation across the inheritance hierarchy.
Property Serialization Extension
Subclasses may declare a tuple __serialize_properties__ containing
property (or attribute) names that should be appended to the default
dataclass field serialization performed by to_dict.
Example::
from typing import ClassVar
@dataclass
class MyEntity(DomoBase):
id: str
value: int
__serialize_properties__: ClassVar[tuple] = ("display_url",)
@property
def display_url(self) -> str: # will be included automatically
return f"https://example.com/{self.id}"
MyEntity(id="123", value=5).to_dict()
# {'id': '123', 'value': 5, 'displayUrl': 'https://example.com/123'}
MyEntity(id="123", value=5).to_dict(return_snake_case=True)
# {'id': '123', 'value': 5, 'display_url': 'https://example.com/123'}
Notes:
* Only fields with repr=True and non-None values are emitted.
* Properties listed in __serialize_properties__ are always included (even if None).
* Properties that raise exceptions are skipped safely.
* Dataclass fields take precedence over property names with the same identifier.
* Use return_snake_case=True to get snake_case keys instead of camelCase.
to_dict ¶
to_dict(
override_fn: Callable | None = None,
return_snake_case: bool = False,
) -> dict
Convert dataclass to dictionary with camelCase or snake_case keys, excluding fields with repr=False.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional callable that receives |
None
|
return_snake_case
|
bool
|
If True, return keys in snake_case. If False (default), return camelCase. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary with camelCase (default) or snake_case keys and corresponding values. |
Source code in src/crew_dcs/base/base.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
DomoEntity
dataclass
¶
DomoEntity(auth: DomoAuth, id: str, raw: dict)
Bases: DomoBase
Base class for all Domo entities (datasets, cards, pages, users, etc.).
Provides core functionality including authentication, unique identification, data conversion utilities, and relationship management. All concrete entity types should inherit from this class or one of its subclasses.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests (hidden in repr) |
id |
str
|
Unique identifier for the entity |
raw |
dict
|
Raw API response data for the entity (hidden in repr) |
Relations |
Any
|
Relationship controller for managing entity relationships |
Class Attributes
entity_type: The Domo entity type string (e.g., "DATA_SOURCE", "PAGE"). Concrete subclasses MUST set this. Intermediate/abstract bases that don't override it are skipped by auto-registration. has_lineage: Whether this entity type supports lineage tracking. Defaults to False on DomoEntity, True on DomoEntity_w_Lineage.
display_url is a property each concrete subclass implements.
display_url
abstractmethod
property
¶
display_url: str
Generate the URL to display this entity in the Domo interface.
This method should return the direct URL to view the entity in Domo's web interface, allowing users to navigate directly to the entity.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Complete URL to view the entity in Domo |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
entity_name
property
¶
entity_name: str
Get the display name for this entity.
Tries common name fields in order: name, title, display_name. Falls back to entity ID if no name is found.
Subclasses can override this property to use entity-specific name fields.
Returns:
| Type | Description |
|---|---|
str
|
Display name for the entity, or entity ID as fallback |
create
async
classmethod
¶
create(auth: DomoAuth, **kwargs) -> DomoEntity
Create a new entity and return it (classmethod: no instance yet).
Creatable entities override this to build the create payload (typically via a builder) and call the corresponding route.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support creation. |
Source code in src/crew_dcs/base/entities.py
305 306 307 308 309 310 311 312 313 314 315 | |
delete
async
¶
delete(**kwargs)
Delete this entity.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support deletion. |
Source code in src/crew_dcs/base/entities.py
325 326 327 328 329 330 331 | |
dispatch_get_by_id
async
classmethod
¶
dispatch_get_by_id(
auth: DomoAuth,
entity_type: str,
entity_id: str,
**kwargs,
)
Route entity_type + entity_id to the right subclass.get_entity_by_id().
The entity class must already be imported (which triggers init_subclass registration). If you get a "not registered" error, import the entity module before calling this method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
entity_type
|
str
|
The Domo entity type string (e.g., "DATA_SOURCE", "PAGE") |
required |
entity_id
|
str
|
Unique identifier of the entity to retrieve |
required |
**kwargs
|
Additional arguments passed to the subclass's get_entity_by_id |
{}
|
Returns:
| Type | Description |
|---|---|
|
An instance of the appropriate DomoEntity subclass |
Raises:
| Type | Description |
|---|---|
ValueError
|
If entity_type is not registered |
Source code in src/crew_dcs/base/entities.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
from_dict
abstractmethod
classmethod
¶
from_dict(auth: DomoAuth, obj: dict[str, Any])
Create an entity instance from a dictionary representation.
This method should be implemented by subclasses to handle the conversion from API response dictionaries to entity objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
obj
|
dict[str, Any]
|
Dictionary representation of the entity from the API |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
get_by_id
abstractmethod
async
classmethod
¶
get_by_id(
auth: DomoAuth,
id: str,
debug_num_stacks_to_drop=2,
debug_api: bool = False,
session: AsyncClient | None = None,
)
Fetch an entity by its unique identifier.
This method should be implemented by subclasses to handle entity-specific retrieval logic from the Domo API.
Concrete subclasses name the id parameter for the entity (user_id,
dataset_id, card_id, page_id, group_id, account_id,
dataflow_id). For a uniform entity_id keyword, call
get_entity_by_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
id
|
str
|
Unique identifier of the entity to retrieve |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
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 | |
get_entity_by_id
abstractmethod
async
classmethod
¶
get_entity_by_id(
auth: DomoAuth,
entity_id: str,
debug_num_stacks_to_drop: int = 2,
debug_api: bool = False,
session: AsyncClient | None = None,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Any | None = None,
parent_auth: Any | None = None,
**kwargs,
)
Fetch an entity by its ID
This method should be implemented by subclasses to fetch the specific entity type while ensuring lineage tracking is properly initialized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
entity_id
|
str
|
Unique identifier of the entity to retrieve |
required |
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop for debug logging (default: 2) |
2
|
debug_api
|
bool
|
Enable API debug logging (default: False) |
False
|
session
|
AsyncClient | None
|
Optional HTTP client session |
None
|
check_if_published
|
bool | None
|
When True attempt to resolve publish subscriptions. If None and either parent_auth or parent_auth_retrieval_fn is provided, subclasses should default to True. |
None
|
parent_auth_retrieval_fn
|
Any | None
|
Callable used to obtain publisher auth for publish checks |
None
|
parent_auth
|
Any | None
|
Pre-existing publisher auth (alternative to parent_auth_retrieval_fn) |
None
|
**kwargs
|
Additional arguments passed to the underlying get_by_id method |
{}
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | |
refresh
async
¶
refresh(
debug_num_stacks_to_drop=2,
debug_api: bool = False,
session: AsyncClient | None = None,
**kwargs,
)
Refresh this instance from the API using its id and auth.
Source code in src/crew_dcs/base/entities.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
to_dict ¶
to_dict(
override_fn: Callable | None = None,
return_snake_case: bool = False,
) -> dict
Convert all dataclass attributes to a dictionary in camelCase or snake_case.
This method is useful for serializing entity data for API requests or data export operations.
Only fields with repr=True are included, plus any properties listed in serialize_properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Custom conversion function to override default behavior |
None
|
return_snake_case
|
bool
|
If True, return keys in snake_case. If False (default), return camelCase. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary with camelCase (default) or snake_case keys and corresponding attribute values |
Example
entity.to_dict() {'id': '123', 'displayName': 'My Entity', 'displayUrl': '...', ...} entity.to_dict(return_snake_case=True) {'id': '123', 'display_name': 'My Entity', 'display_url': '...', ...}
Source code in src/crew_dcs/base/entities.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
update
async
¶
update(**kwargs) -> DomoEntity
Update this entity in place and return self.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support update. |
Source code in src/crew_dcs/base/entities.py
317 318 319 320 321 322 323 | |
DomoEntityLineageProtocol ¶
Bases: Protocol
Structural interface for lineage-capable entities.
DomoEntity_w_Lineage
dataclass
¶
DomoEntity_w_Lineage(auth: DomoAuth, id: str, raw: dict)
Bases: DomoEntity
Entity with lineage tracking capabilities.
Extends DomoEntity to include lineage tracking functionality, enabling entities to track their relationships and dependencies within the Domo ecosystem.
Attributes:
| Name | Type | Description |
|---|---|---|
Lineage |
Any | None
|
Lineage tracking object for dependency management (hidden in repr) |
Federation |
Any | None
|
Federation context for publish/subscribe state (hidden in repr) |
__skip_lineage_registration__ |
Any | None
|
Class attribute to opt out of registration requirement. Set to True for abstract or intermediate base classes that should not be registered. |
name
property
¶
name: str
Get the display name for this entity.
All entities with lineage provide a name property for consistent identification in lineage diagrams and reports.
Entities that use 'title' (DomoCard, DomoPage) should override this as: @property def name(self) -> str: return self.title or f"Untitled {self.entity_type}"
Entities with a 'name' attribute (DomoDataset, DomoDataflow, DomoPublication) will use their dataclass field directly.
Returns:
| Type | Description |
|---|---|
str
|
Display name for the entity |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If entity doesn't have name, title, or override this property |
enable_federation_support ¶
enable_federation_support()
Ensure this entity has an attached FederationContext helper. returns FederationContext instance.
Source code in src/crew_dcs/base/entities.py
536 537 538 539 540 541 542 543 544 545 546 | |
probe_is_published
async
classmethod
¶
probe_is_published(
entity_id: str,
subscriber_auth: DomoAuth,
parent_auth: DomoAuth | None = None,
parent_auth_retrieval_fn: Callable | None = None,
session: AsyncClient | None = None,
debug_api: bool = False,
max_subscriptions_to_check: int | None = None,
context: RouteContext | None = None,
)
Check if entity is published (federated) - works for all entity types.
Uses lineage type registry to determine entity type automatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_id
|
str
|
Entity identifier to check |
required |
subscriber_auth
|
DomoAuth
|
Auth for subscriber instance |
required |
parent_auth
|
DomoAuth | None
|
Optional pre-existing publisher auth |
None
|
parent_auth_retrieval_fn
|
Callable | None
|
Callable to retrieve publisher auth |
None
|
session
|
AsyncClient | None
|
Optional HTTP session for reuse |
None
|
debug_api
|
bool
|
Enable debug logging |
False
|
max_subscriptions_to_check
|
int | None
|
Limit subscription checking |
None
|
context
|
RouteContext | None
|
Optional pre-built context |
None
|
Returns:
| Type | Description |
|---|---|
|
FederationContext with subscription info if published |
Raises:
| Type | Description |
|---|---|
ValueError
|
If class not registered with lineage type or missing auth |
Source code in src/crew_dcs/base/entities.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 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
DomoEnumMixin ¶
Enhanced Enum mixin with case-insensitive lookup and default value support.
This mixin provides case-insensitive string matching and falls back to a default value when no match is found. All subclasses should define a 'default' member.
get
classmethod
¶
get(value: Any) -> _EnumT | None
Get enum member by case-insensitive string lookup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
String value to look up (case-insensitive) |
required |
Returns:
| Type | Description |
|---|---|
_EnumT | None
|
Enum member if found, otherwise the default member, or None if no default exists |
Source code in src/crew_dcs/base/base.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
DomoManager
dataclass
¶
DomoManager(auth: DomoAuth)
Bases: DomoBase
Base class for entity managers that handle collections of entities.
Provides the foundation for manager classes that handle operations on collections of entities (e.g., DomoDatasets, DomoGroups, DomoUsers).
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests (hidden in repr) |
get
abstractmethod
async
¶
get(*args: Any, **kwargs: Any) -> list[DomoEntity]
Retrieve entities based on provided criteria.
Must be implemented by subclasses to handle entity-specific retrieval and filtering logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Positional arguments for entity retrieval |
()
|
**kwargs
|
Any
|
Keyword arguments for filtering and options |
{}
|
Returns:
| Type | Description |
|---|---|
list[DomoEntity]
|
list[DomoEntity]: List of entity instances retrieved |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | |
DomoPublicationProtocol ¶
Bases: Protocol
Structural interface for publication objects.
DomoSubEntity
dataclass
¶
DomoSubEntity(parent: DomoEntity)
Bases: DomoBase
Base class for entities that belong to a parent entity.
Handles entities that are sub-components of other entities, such as columns in a dataset or slides in a page. Automatically inherits authentication and parent references.
Attributes:
| Name | Type | Description |
|---|---|---|
parent |
DomoEntity
|
Reference to the parent entity |
auth |
Authentication object (inherited from parent, hidden in repr) |
from_parent
classmethod
¶
from_parent(parent: DomoEntity)
Create a sub-entity instance from a parent entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
DomoEntity
|
The parent entity to derive from |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DomoSubEntity |
New sub-entity instance with inherited properties |
Source code in src/crew_dcs/base/entities.py
725 726 727 728 729 730 731 732 733 734 735 | |
DomoSubscriptionProtocol ¶
Bases: Protocol
Structural interface for subscription objects.
FederationContext
dataclass
¶
FederationContext(
parent: DomoEntityLineageProtocol | None = None,
subscription: DomoSubscriptionProtocol | None = None,
parent_publication: DomoPublicationProtocol
| None = None,
publisher_entity: DomoEntityLineageProtocol
| None = None,
_parent_auth_fn: Callable[
[str], DomoAuth | Awaitable[DomoAuth]
]
| None = None,
_parent_auth: DomoAuth | None = None,
_content_type: str | None = None,
_entity_id: str | None = None,
_auth: DomoAuth | None = None,
)
Bases: DomoBase
Holds resolved federation state for federated entities.
Attached to subscriber-side entities that are copies from another instance. Manages subscription/publication discovery and caching.
Can be attached to a parent entity via constructor, or created standalone using from_entity_id() for probing publish state without a full entity.
check_if_published
async
¶
check_if_published(
*,
retrieve_parent_auth_fn: Callable[
[str], DomoAuth | Awaitable[DomoAuth]
],
entity_type: str,
entity_id: str | None = None,
context: RouteContext | None = None,
session: AsyncClient | None = None,
debug_api: bool = False,
max_subscriptions_to_check: int | None = None,
**context_kwargs,
) -> bool
Discover whether the entity participates in a subscription.
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
ensure_subscription
async
¶
ensure_subscription(
*,
retrieve_parent_auth_fn: Callable[
[str], DomoAuth | Awaitable[DomoAuth]
]
| None = None,
parent_auth: DomoAuth | None = None,
entity_type: str | None = None,
entity_id: str | None = None,
session: AsyncClient | None = None,
debug_api: bool = False,
max_subscriptions_to_check: int | None = None,
context: RouteContext | None = None,
**context_kwargs,
) -> DomoSubscriptionProtocol | None
Ensure subscription data is loaded, running discovery if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
retrieve_parent_auth_fn
|
Callable[[str], DomoAuth | Awaitable[DomoAuth]] | None
|
Callable to retrieve parent auth by domain |
None
|
parent_auth
|
DomoAuth | None
|
Pre-existing parent auth (alternative to retrieval function) |
None
|
entity_type
|
str | None
|
Entity type (DATA_SOURCE, CARD, PAGE, etc.) |
None
|
entity_id
|
str | None
|
The entity identifier |
None
|
session
|
AsyncClient | None
|
HTTP session for API calls |
None
|
debug_api
|
bool
|
Enable debug logging |
False
|
max_subscriptions_to_check
|
int | None
|
Limit subscription search |
None
|
Returns:
| Type | Description |
|---|---|
DomoSubscriptionProtocol | None
|
The subscription object if found |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no auth method available |
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
from_entity_id
classmethod
¶
from_entity_id(
*, auth: DomoAuth, entity_id: str, entity_type: str
) -> FederationContext
Create a federation context from entity identifiers (no parent entity required).
Use this factory when you need to check publish state without constructing a full entity object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication for the subscriber instance |
required |
entity_id
|
str
|
The entity identifier to check |
required |
entity_type
|
str
|
The entity type (DATA_SOURCE, CARD, PAGE, etc.) |
required |
Returns:
| Type | Description |
|---|---|
FederationContext
|
FederationContext instance ready for publish state checks |
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
get_parent_publication
async
¶
get_parent_publication(
*,
parent_auth: DomoAuth | None = None,
is_fetch_content_details: bool = True,
context: RouteContext | None = None,
**context_kwargs,
) -> DomoPublicationProtocol
Fetch and cache the parent publication for this entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_auth
|
DomoAuth | None
|
Pre-existing publisher auth |
None
|
is_fetch_content_details
|
bool
|
If True, automatically call get_content_details() on the publication before returning. This ensures content mapping is available for indirect resolution. Default: True. |
True
|
context
|
RouteContext | None
|
Route context |
None
|
**context_kwargs
|
Additional context args |
{}
|
Returns:
| Type | Description |
|---|---|
DomoPublicationProtocol
|
DomoPublication with content details loaded (if is_fetch_content_details=True) |
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
get_publisher_auth
async
¶
get_publisher_auth(
parent_auth: Any = None,
context: RouteContext | None = None,
**context_kwargs,
) -> DomoAuth
Public helper to resolve publisher authentication.
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
343 344 345 346 347 348 349 350 351 352 353 354 355 | |
hydrate_from_existing ¶
hydrate_from_existing(
*,
subscription: DomoSubscriptionProtocol,
parent_auth_retrieval_fn: Callable[
[str], DomoAuth | Awaitable[DomoAuth]
]
| None = None,
parent_auth: DomoAuth | None = None,
content_type: str,
entity_id: str,
)
Attach an already-discovered subscription to this helper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription
|
DomoSubscriptionProtocol
|
The subscription object |
required |
parent_auth_retrieval_fn
|
Callable[[str], DomoAuth | Awaitable[DomoAuth]] | None
|
Callable to retrieve parent auth by domain |
None
|
parent_auth
|
DomoAuth | None
|
Pre-existing parent auth (alternative to retrieval function) |
None
|
content_type
|
str
|
Entity type (DATA_SOURCE, CARD, PAGE, etc.) |
required |
entity_id
|
str
|
The entity identifier |
required |
Source code in src/crew_dcs/classes/subentity/lineage/federation_context.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
FederationContextProtocol ¶
Bases: Protocol
Structural interface for federation helpers.
PublishResolver
dataclass
¶
PublishResolver(
subscriber_auth: DomoAuth,
parent_auth_retrieval_fn: Callable[
[str, RouteContext], Any | Awaitable[Any]
],
session: AsyncClient | None = None,
debug_api: bool = False,
max_subscriptions_to_check: int | None = None,
)
Resolve subscriptions for subscriber-side entities.
get_subscription_for_entity
async
¶
get_subscription_for_entity(
*,
entity_type: ContentType,
subscriber_entity_id: str,
context: RouteContext | None = None,
**context_kwargs: Any,
) -> dict[str, Any]
Find the subscription that contains the given subscriber entity.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Raw subscription summary dict from the API. Callers should hydrate |
dict[str, Any]
|
this into a DomoSubscription instance in the classes layer. |
Calls route
Source code in src/crew_dcs/classes/subentity/lineage/publish_resolver.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |