Skip to content

core

core

DomoEverywhere dataclass

DomoEverywhere(
    auth: DomoAuth,
    publications: list[DomoPublication] = None,
    subscriptions: list[DomoSubscription] = None,
    invitations: list[dict[str, Any]] = None,
)

Instance-wide Domo Everywhere access: publications, subscriptions, invites.

accept_invite_by_id async

accept_invite_by_id(
    subscription_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> Any

Accept a subscription invitation.

Parameters:

Name Type Description Default
subscription_id str

ID of the subscription invitation.

required
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
Any

The response payload on HTTP 200, otherwise None.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
async def accept_invite_by_id(
    self,
    subscription_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> Any:
    """Accept a subscription invitation.

    Args:
        subscription_id: ID of the subscription invitation.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The response payload on HTTP 200, otherwise None.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await publish_routes.accept_invite_by_id(
        auth=self.auth,
        subscription_id=subscription_id,
        context=context,
    )

    if res.status == 200:
        return res.response
    return None

count_subscription_invites async

count_subscription_invites(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Count subscription invites (/subscriptions/invites/counts).

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
async def count_subscription_invites(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Count subscription invites (``/subscriptions/invites/counts``).

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.count_subscription_invites(
        auth=self.auth,
        context=context,
    )

count_subscription_summaries async

count_subscription_summaries(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Count subscription summaries (/subscriptions/summaries/counts).

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
async def count_subscription_summaries(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Count subscription summaries (``/subscriptions/summaries/counts``).

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.count_subscription_summaries(
        auth=self.auth,
        context=context,
    )

get_publications async

get_publications(
    search_term: str | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> list[DomoPublication] | ResponseGetData

Get this instance's publications.

Parameters:

Name Type Description Default
search_term str | None

Optional text to filter publications by.

None
return_raw bool

If True, return the raw search response.

False
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
list[DomoPublication] | ResponseGetData

The publications (also stored on publications), or the raw

list[DomoPublication] | ResponseGetData

response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
async def get_publications(
    self,
    search_term: str | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> list[DomoPublication] | rgd.ResponseGetData:
    """Get this instance's publications.

    Args:
        search_term: Optional text to filter publications by.
        return_raw: If True, return the raw search response.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The publications (also stored on ``publications``), or the raw
        response when ``return_raw`` is True.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await publish_routes.search_publications(
        auth=self.auth,
        search_term=search_term,
        context=context,
    )

    if return_raw:
        return res

    self.publications = await dmce.gather_with_concurrency(
        n=60,
        *[  # noqa: B026
            DomoPublication.get_by_id(
                publication_id=obj.get("id"), auth=self.auth, context=context
            )
            for obj in res.response
        ],
    )
    return self.publications

get_subscription_invitations async

get_subscription_invitations(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get this instance's pending subscription invitations.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response (its payload is also stored on invitations).

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
async def get_subscription_invitations(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get this instance's pending subscription invitations.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response (its payload is also stored on ``invitations``).
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await publish_routes.get_subscription_invitations(
        auth=self.auth,
        context=context,
    )

    self.invitations = res.response

    return res

get_subscription_invite_counts async

get_subscription_invite_counts(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Count subscription invites (/subscription/invites/counts).

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
async def get_subscription_invite_counts(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Count subscription invites (``/subscription/invites/counts``).

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.get_subscription_invite_counts(
        auth=self.auth,
        context=context,
    )

get_subscription_status async

get_subscription_status(
    package_publication_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get subscription status for a package publication.

Parameters:

Name Type Description Default
package_publication_id str

Package publication ID.

required
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
async def get_subscription_status(
    self,
    package_publication_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get subscription status for a package publication.

    Args:
        package_publication_id: Package publication ID.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.get_subscription_status(
        auth=self.auth,
        package_publication_id=package_publication_id,
        context=context,
    )

get_subscription_summaries_by_pub_id async

get_subscription_summaries_by_pub_id(
    pub_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get the subscription summaries of one publication.

Parameters:

Name Type Description Default
pub_id str

Publication ID.

required
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
async def get_subscription_summaries_by_pub_id(
    self,
    pub_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get the subscription summaries of one publication.

    Args:
        pub_id: Publication ID.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.get_subscription_summaries_by_pub_id(
        auth=self.auth,
        pub_id=pub_id,
        context=context,
    )

get_subscription_summary_counts async

get_subscription_summary_counts(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Count subscription summaries (/subscription/summaries/counts).

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
async def get_subscription_summary_counts(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Count subscription summaries (``/subscription/summaries/counts``).

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.get_subscription_summary_counts(
        auth=self.auth,
        context=context,
    )

get_subscriptions async

get_subscriptions(
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> list[DomoSubscription] | ResponseGetData

Get this instance's subscription summaries.

Parameters:

Name Type Description Default
return_raw bool

If True, return the raw summaries response.

False
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
list[DomoSubscription] | ResponseGetData

The subscriptions (also stored on subscriptions), or the raw

list[DomoSubscription] | ResponseGetData

response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
async def get_subscriptions(
    self,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> list[DomoSubscription] | rgd.ResponseGetData:
    """Get this instance's subscription summaries.

    Args:
        return_raw: If True, return the raw summaries response.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The subscriptions (also stored on ``subscriptions``), or the raw
        response when ``return_raw`` is True.
    """

    self.subscriptions = []

    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await publish_routes.get_subscription_summaries(
        auth=self.auth,
        context=context,
    )

    if return_raw:
        return res

    for sub in res.response:
        domo_sub = DomoSubscription.from_dict(auth=self.auth, obj=sub)

        if sub in self.subscriptions:
            continue
        self.subscriptions.append(domo_sub)

    return self.subscriptions

list_all_subscriptions async

list_all_subscriptions(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

List every subscription on this instance.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
async def list_all_subscriptions(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """List every subscription on this instance.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.list_all_subscriptions(
        auth=self.auth,
        context=context,
    )

list_public_subscription_invites async

list_public_subscription_invites(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

List public subscription invites.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
async def list_public_subscription_invites(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """List public subscription invites.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.list_public_subscription_invites(
        auth=self.auth,
        context=context,
    )

list_subscription_invites async

list_subscription_invites(
    limit: int | None = None,
    offset: int | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

List subscription invites.

Parameters:

Name Type Description Default
limit int | None

Optional page size.

None
offset int | None

Optional page offset.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
async def list_subscription_invites(
    self,
    limit: int | None = None,
    offset: int | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """List subscription invites.

    Args:
        limit: Optional page size.
        offset: Optional page offset.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.list_subscription_invites(
        auth=self.auth,
        limit=limit,
        offset=offset,
        context=context,
    )

list_subscription_summaries async

list_subscription_summaries(
    limit: int | None = None,
    offset: int | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

List subscription summaries.

Parameters:

Name Type Description Default
limit int | None

Optional page size.

None
offset int | None

Optional page offset.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
async def list_subscription_summaries(
    self,
    limit: int | None = None,
    offset: int | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """List subscription summaries.

    Args:
        limit: Optional page size.
        offset: Optional page offset.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    return await publish_subscription_routes.list_subscription_summaries(
        auth=self.auth,
        limit=limit,
        offset=offset,
        context=context,
    )

search_publications async

search_publications(
    search_term: str | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> list[DomoPublication] | ResponseGetData

Search this instance's publications (alias of get_publications).

Parameters:

Name Type Description Default
search_term str | None

Optional text to filter publications by.

None
return_raw bool

If True, return the raw search response.

False
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
list[DomoPublication] | ResponseGetData

The publications, or the raw response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
async def search_publications(
    self,
    search_term: str | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> list[DomoPublication] | rgd.ResponseGetData:
    """Search this instance's publications (alias of ``get_publications``).

    Args:
        search_term: Optional text to filter publications by.
        return_raw: If True, return the raw search response.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The publications, or the raw response when ``return_raw`` is True.
    """
    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await self.get_publications(
        search_term=search_term,
        return_raw=return_raw,
        context=context,
    )

    return res  # noqa: RET504

DomoPublication dataclass

DomoPublication(
    auth: DomoAuth,
    id: str,
    raw: dict,
    name: str = None,
    description: str = None,
    is_v2: bool = None,
    created_dt: datetime = None,
    updated_dt: datetime = None,
    subscriptions: list[DomoSubscription] = None,
    content: list[DomoPublication_Content] = None,
)

Bases: DomoEntity_w_Lineage

A Domo Everywhere publication: content a publisher sends to subscribers.

display_url property

display_url: str

URL of this publication's details page in the Domo admin UI.

create_publication async classmethod

create_publication(
    auth: DomoAuth,
    name: str,
    content_ls: list[DomoPublication_Content],
    subscription_ls: list[DomoSubscription],
    unique_id: str | None = None,
    description: str | None = None,
    debug_api: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> DomoPublication

Create a publication.

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session (the publisher).

required
name str

Publication name.

required
content_ls list[DomoPublication_Content]

Content to publish.

required
subscription_ls list[DomoSubscription]

Subscribers to publish to.

required
unique_id str | None

Optional publication ID; a UUID is generated if omitted.

None
description str | None

Optional description.

None
debug_api bool

Enable API debug logging.

False
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
DomoPublication

The created publication.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
@classmethod
async def create_publication(
    cls,
    auth: DomoAuth,
    name: str,
    content_ls: list[DomoPublication_Content],
    subscription_ls: list[DomoSubscription],
    unique_id: str | None = None,
    description: str | None = None,
    debug_api: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> DomoPublication:
    """Create a publication.

    Args:
        auth: Authenticated Domo session (the publisher).
        name: Publication name.
        content_ls: Content to publish.
        subscription_ls: Subscribers to publish to.
        unique_id: Optional publication ID; a UUID is generated if omitted.
        description: Optional description.
        debug_api: Enable API debug logging.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The created publication.
    """
    if not isinstance(subscription_ls, list):
        subscription_ls = [subscription_ls]

    domain_ls = []
    content_json_ls = []
    for sub in subscription_ls:
        domain_ls.append(sub.subscriber_domain)
    for content_item in content_ls:
        content_json_ls.append(content_item.to_api_json())

    unique_id = unique_id or str(uuid.uuid4())

    body = publish_routes.generate_publish_body(
        url=f"{auth.domo_instance}.domo.com",
        sub_domain_ls=domain_ls,
        content_ls=content_json_ls,
        name=name,
        unique_id=unique_id,
        description=description or "",
        is_new=True,
    )

    context = RouteContext.build_context(
        context=context,
        debug_api=debug_api,
        **context_kwargs,
    )

    res = await publish_routes.create_publish_job(
        auth=auth,
        body=body,
        context=context,
    )

    return cls.from_dict(auth=auth, obj=res.response)

from_dict classmethod

from_dict(
    auth: DomoAuth, obj: dict[str, Any]
) -> DomoPublication

Build a publication from an API payload.

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session.

required
obj dict[str, Any]

The publication payload.

required

Returns:

Type Description
DomoPublication

The publication entity, with subscriptions and content populated.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
303
304
305
@classmethod
def from_dict(cls, auth: DomoAuth, obj: dict[str, Any]) -> DomoPublication:
    """Build a publication from an API payload.

    Args:
        auth: Authenticated Domo session.
        obj: The publication payload.

    Returns:
        The publication entity, with subscriptions and content populated.
    """
    domo_pub = cls(
        id=obj["id"],
        name=obj["name"],
        description=obj["description"],
        created_dt=(
            dt.datetime.fromtimestamp(obj["created"] / 1000)
            if obj["created"]
            else None
        ),
        updated_dt=(
            dt.datetime.fromtimestamp(obj.get("content").get("updated") / 1000)
            if obj.get("content").get("updated")
            else None
        ),
        is_v2=obj["isV2"],
        auth=auth,
        raw=obj,
    )

    if (
        obj.get("subscriptionAuthorizations")
        and len(obj.get("subscriptionAuthorizations")) > 0
    ):
        domo_pub._generate_subscriptions(
            subscription_authorizations_ls=obj["subscriptionAuthorizations"],
            auth=auth,
        )

    if obj.get("children") and len(obj.get("children")) > 0:
        domo_pub._generate_content(obj["children"])

    return domo_pub

get_by_id async classmethod

get_by_id(
    publication_id: str,
    auth: DomoAuth,
    return_raw: bool = False,
    timeout: int = 10,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> DomoPublication | ResponseGetData

Get a publication by ID.

Parameters:

Name Type Description Default
publication_id str

Publication ID.

required
auth DomoAuth

Authenticated Domo session.

required
return_raw bool

If True, return the raw response instead of an entity.

False
timeout int

Request timeout in seconds.

10
debug_api bool

Enable API debug logging.

False
debug_num_stacks_to_drop int

Stack frames to drop in debug output.

2
session AsyncClient | None

Optional shared HTTP client.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
DomoPublication | ResponseGetData

The publication, or the raw response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
@classmethod
async def get_by_id(
    cls,
    publication_id: str,
    auth: DomoAuth,
    return_raw: bool = False,
    timeout: int = 10,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> DomoPublication | rgd.ResponseGetData:
    """Get a publication by ID.

    Args:
        publication_id: Publication ID.
        auth: Authenticated Domo session.
        return_raw: If True, return the raw response instead of an entity.
        timeout: Request timeout in seconds.
        debug_api: Enable API debug logging.
        debug_num_stacks_to_drop: Stack frames to drop in debug output.
        session: Optional shared HTTP client.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The publication, or the raw response when ``return_raw`` is True.
    """
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=debug_num_stacks_to_drop,
        **context_kwargs,
    )

    res = await publish_routes.get_publication_by_id(
        auth=auth,
        publication_id=publication_id,
        timeout=timeout,
        context=context,
    )

    if return_raw:
        return res

    return cls.from_dict(auth=auth, obj=res.response)

get_content_details async

get_content_details(
    subscriber_domain: str,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Map this publication's content to the subscriber's copies.

Sets subscriber_content_id and subscriber_insance on each content item.

Parameters:

Name Type Description Default
subscriber_domain str

Subscriber instance domain; .domo.com is appended if missing.

required
debug_api bool

Enable API debug logging.

False
debug_num_stacks_to_drop int

Stack frames to drop in debug output.

2
session AsyncClient | None

Optional shared HTTP client.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The content-details response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
async def get_content_details(
    self,
    subscriber_domain: str,  # must include .domo.com
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Map this publication's content to the subscriber's copies.

    Sets ``subscriber_content_id`` and ``subscriber_insance`` on each content item.

    Args:
        subscriber_domain: Subscriber instance domain; ``.domo.com`` is appended if missing.
        debug_api: Enable API debug logging.
        debug_num_stacks_to_drop: Stack frames to drop in debug output.
        session: Optional shared HTTP client.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The content-details response.
    """
    if not subscriber_domain.lower().endswith(".domo.com"):
        subscriber_domain = f"{subscriber_domain}.domo.com"

    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=debug_num_stacks_to_drop,
        **context_kwargs,
    )

    res = await publish_routes.get_subscriber_content_details(
        auth=self.auth,
        publication_id=self.id,
        subscriber_instance=subscriber_domain,
        context=context,
    )

    publication_content = self.content

    for content in publication_content:
        subscriber_obj = next(
            (
                subscriber_obj
                for subscriber_obj in res.response
                if subscriber_obj["publisherObjectId"] == content.entity_id
                and subscriber_obj["contentType"] == content.entity_type
            ),
            None,
        )
        if subscriber_obj is not None:
            content.subscriber_content_id = subscriber_obj["subscriberObjectId"]
            content.subscriber_insance = subscriber_obj["subscriberDomain"]

    self.content = publication_content

    return res

get_entity_by_id async classmethod

get_entity_by_id(
    entity_id: str, **kwargs: Any
) -> DomoPublication | ResponseGetData

Get a publication by ID (generic entity entry point).

Parameters:

Name Type Description Default
entity_id str

Publication ID.

required
**kwargs Any

Forwarded to get_by_id.

{}

Returns:

Type Description
DomoPublication | ResponseGetData

The publication, or the raw response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
357
358
359
360
361
362
363
364
365
366
367
368
369
370
@classmethod
async def get_entity_by_id(
    cls, entity_id: str, **kwargs: Any
) -> DomoPublication | rgd.ResponseGetData:
    """Get a publication by ID (generic entity entry point).

    Args:
        entity_id: Publication ID.
        **kwargs: Forwarded to ``get_by_id``.

    Returns:
        The publication, or the raw response when ``return_raw`` is True.
    """
    return await cls.get_by_id(publication_id=entity_id, **kwargs)

get_publisher_entity_for_subscriber async

get_publisher_entity_for_subscriber(
    subscriber_entity: Any,
    subscriber_domain: str,
    *,
    include_indirect: bool = True,
    context: RouteContext | None = None,
    **context_kwargs
) -> Any

Get publisher entity with automatic direct/indirect resolution.

Handles: - Direct publication (entity in publication content) - Indirect publication (cards on published pages) - Multi-page publications - App Studio caveats

Parameters:

Name Type Description Default
subscriber_entity Any

Subscriber-side entity

required
subscriber_domain str

Subscriber instance domain

required
include_indirect bool

Enable indirect resolution (cards on pages)

True
context RouteContext | None

Route context

None
**context_kwargs

Additional context args

{}

Returns:

Type Description
Any

Publisher entity or None if not found

Raises:

Type Description
NotImplementedError

If App Studio indirect resolution attempted

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
509
510
511
512
513
514
515
516
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
547
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
640
641
642
643
644
645
646
647
648
649
async def get_publisher_entity_for_subscriber(  # noqa: C901
    self,
    subscriber_entity: Any,  # DomoEntity_w_Lineage
    subscriber_domain: str,
    *,
    include_indirect: bool = True,
    context: RouteContext | None = None,
    **context_kwargs,
) -> Any:  # DomoCard, DomoDataset, DomoPage
    """Get publisher entity with automatic direct/indirect resolution.

    Handles:
    - Direct publication (entity in publication content)
    - Indirect publication (cards on published pages)
    - Multi-page publications
    - App Studio caveats

    Args:
        subscriber_entity: Subscriber-side entity
        subscriber_domain: Subscriber instance domain
        include_indirect: Enable indirect resolution (cards on pages)
        context: Route context
        **context_kwargs: Additional context args

    Returns:
        Publisher entity or None if not found

    Raises:
        NotImplementedError: If App Studio indirect resolution attempted
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    # Check cache first
    cache_key = f"{subscriber_entity.entity_type}:{subscriber_entity.id}"
    cache = self.raw.setdefault("_indirect_resolution_cache", {})

    if cache_key in cache:
        return cache[cache_key]

    # Get content mapping
    res = await self.get_content_details(
        subscriber_domain=subscriber_domain,
        context=context,
    )

    # Try direct match (normalize dataset content type aliases)
    normalized_entity_type = (subscriber_entity.entity_type or "").upper()
    acceptable_content_types = {normalized_entity_type}
    # entity_type is now consistently "DATA_SOURCE" (not "DATASET"),
    # but the API may return either value, so accept both aliases
    if normalized_entity_type in ("DATA_SOURCE", "DATASET"):
        acceptable_content_types.update({"DATA_SOURCE", "DATASET"})

    direct_match = next(
        (
            row
            for row in res.response
            if str(row["subscriberObjectId"]) == str(subscriber_entity.id)
            and (row.get("contentType") or "").upper() in acceptable_content_types
        ),
        None,
    )

    if direct_match:
        # Direct publication - simple case
        publisher_obj_id = direct_match["publisherObjectId"]

        publisher_entity = await subscriber_entity.get_entity_by_id(
            entity_id=publisher_obj_id, auth=self.auth
        )

        cache[cache_key] = publisher_entity
        return publisher_entity

    # No direct match - try indirect resolution if enabled
    if not include_indirect:
        return None

    if subscriber_entity.entity_type != "CARD":
        # Only cards can be indirectly published (via pages)
        return None

    # Find PAGE entries in publication
    page_contents = [c for c in self.content if c.entity_type == "PAGE"]

    if not page_contents:
        # Check for App Studio content
        app_contents = [
            c for c in self.content if c.entity_type in {"APP", "APP_STUDIO_APP"}
        ]
        if app_contents:
            # TODO(#XXX): Implement App Studio card resolution
            raise NotImplementedError(
                f"Indirect publication resolution for App Studio cards is not yet supported.\n"
                f"Card: {subscriber_entity.id}\n"
                f"App Studio content: {[f'{c.entity_type}:{c.entity_id}' for c in app_contents]}\n"
                f"See GitHub issue for tracking."
            )
        return None

    # Prefer mapping by subscriber page IDs when resolving cards
    from ..DomoPage import DomoPage

    subscriber_page_ids: list[str] = []
    if subscriber_entity.Lineage:
        try:
            dependents = await subscriber_entity.Lineage._get_immediate_dependents(
                context=context
            )
            for link in dependents:
                if link.type != "PAGE":
                    continue
                if link.entity is None:
                    link.entity = await link.get_entity(context=context)
                if link.entity:
                    subscriber_page_ids.append(str(link.entity.id))
        except dmde.DomoError:
            subscriber_page_ids = []

    # If we know subscriber pages, narrow to matching published pages
    page_mappings = []
    if subscriber_page_ids:
        page_mappings = [
            row
            for row in res.response
            if row.get("contentType") == "PAGE"
            and str(row.get("subscriberObjectId")) in subscriber_page_ids
        ]

    if page_mappings:
        for row in page_mappings:
            publisher_page = await DomoPage.get_by_id(
                auth=self.auth,
                page_id=row.get("publisherObjectId"),
                context=context,
            )

            publisher_cards = await publisher_page.Layout.get_cards(context=context)

            if not publisher_cards:
                continue

            # Store cards on page for graph building (enables Page→Card edges)
            if publisher_page.Layout:
                publisher_page.Layout.cards = publisher_cards

            # Store page entity in content for graph building
            page_content_match = next(
                (
                    c
                    for c in page_contents
                    if str(c.entity_id) == str(row.get("publisherObjectId"))
                ),
                None,
            )
            if page_content_match:
                page_content_match.entity = publisher_page

            # Match by title (reliable for cards)
            matching_card = next(
                (c for c in publisher_cards if c.title == subscriber_entity.title),
                None,
            )

            if matching_card:
                cache[cache_key] = matching_card
                return matching_card

            # Fallback: single-card page heuristic
            if len(publisher_cards) == 1:
                cache[cache_key] = publisher_cards[0]
                return publisher_cards[0]

    # Fallback: Search each published page for the card (legacy heuristic)
    for page_content in page_contents:
        publisher_page = await DomoPage.get_by_id(
            auth=self.auth,
            page_id=page_content.entity_id,
            context=context,
        )

        publisher_cards = await publisher_page.Layout.get_cards(context=context)

        if not publisher_cards:
            continue

        # Store cards on page for graph building (enables Page→Card edges)
        if publisher_page.Layout:
            publisher_page.Layout.cards = publisher_cards

        # Store page entity in content for graph building
        page_content.entity = publisher_page

        # Match by title (reliable for cards)
        matching_card = next(
            (c for c in publisher_cards if c.title == subscriber_entity.title),
            None,
        )

        if matching_card:
            cache[cache_key] = matching_card
            return matching_card

        # Fallback: single-card page heuristic
        if len(publisher_cards) == 1:
            cache[cache_key] = publisher_cards[0]
            return publisher_cards[0]

    # No matching card found
    return None

revoke_subscription_auth async

revoke_subscription_auth(
    auth: DomoAuth = None,
    subscription_id: str | None = None,
    subscription: DomoSubscription | None = None,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> None

Revoke a subscription's authorization (not yet supported).

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session; defaults to this publication's.

None
subscription_id str | None

Subscription ID; defaults to subscription.id.

None
subscription DomoSubscription | None

Subscription to revoke.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Raises:

Type Description
NotImplementedError

Always; no revoke route exists yet.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
async def revoke_subscription_auth(
    self,
    auth: DomoAuth = None,
    subscription_id: str | None = None,
    subscription: DomoSubscription | None = None,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> None:
    """Revoke a subscription's authorization (not yet supported).

    Args:
        auth: Authenticated Domo session; defaults to this publication's.
        subscription_id: Subscription ID; defaults to ``subscription.id``.
        subscription: Subscription to revoke.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Raises:
        NotImplementedError: Always; no revoke route exists yet.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    # Note: This function may not have a direct route implementation
    # It would need to be implemented based on the available API endpoints
    auth = auth or self.auth
    subscription_id = subscription_id or subscription.id

    # This is a placeholder implementation - would need actual API route
    raise NotImplementedError("revoke_subscription_auth route not yet implemented")

update_publication async

update_publication(
    content_ls: list[DomoPublication_Content] | None = None,
    description: str | None = None,
    name: str | None = None,
    subscription_ls: list[DomoSubscription] | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Update this publication.

Parameters:

Name Type Description Default
content_ls list[DomoPublication_Content] | None

New content list.

None
description str | None

New description; keeps the current one if omitted.

None
name str | None

New name; keeps the current one if omitted.

None
subscription_ls list[DomoSubscription] | None

New subscriber list.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The update response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
async def update_publication(
    self,
    content_ls: list[DomoPublication_Content] | None = None,
    description: str | None = None,
    name: str | None = None,
    subscription_ls: list[DomoSubscription] | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Update this publication.

    Args:
        content_ls: New content list.
        description: New description; keeps the current one if omitted.
        name: New name; keeps the current one if omitted.
        subscription_ls: New subscriber list.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The update response.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    # Use the actual available route
    if not isinstance(subscription_ls, list) and subscription_ls:
        subscription_ls = [subscription_ls]

    domain_ls = []
    content_json_ls = []

    if subscription_ls:
        for sub in subscription_ls:
            domain_ls.append(sub.subscriber_domain)

    if content_ls:
        for content_item in content_ls:
            content_json_ls.append(content_item.to_api_json())

    body = publish_routes.generate_publish_body(
        url=f"{self.auth.domo_instance}.domo.com",
        sub_domain_ls=domain_ls,
        content_ls=content_json_ls,
        name=name or self.name,
        unique_id=self.id,
        description=description or self.description,
        is_new=False,
    )

    context = RouteContext.build_context(context=context, **context_kwargs)

    res = await publish_routes.update_publish_job(
        auth=self.auth,
        publication_id=self.id,
        body=body,
        context=context,
    )

    return res  # noqa: RET504

DomoPublication_Content dataclass

DomoPublication_Content(
    auth: DomoAuth,
    content_id: str,
    entity_type: str,
    entity_id: str,
    entity_domain: str,
    is_v2: bool,
    is_direct_content: bool,
    created_dt: datetime,
    updated_dt: datetime = None,
    subscriber_content_id: str = None,
    subscriber_insance: str = None,
    entity: Any = None,
    parent: Any = None,
)

A piece of publisher content (card, dataset, page, data app) in a publication.

from_dict classmethod

from_dict(
    auth: DomoAuth, obj: dict[str, Any], parent: Any = None
) -> DomoPublication_Content

Build publication content from a publication children entry.

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session.

required
obj dict[str, Any]

One entry of the publication's children list.

required
parent Any

The owning publication, if known.

None

Returns:

Type Description
DomoPublication_Content

The publication content entity.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
@classmethod
def from_dict(
    cls, auth: DomoAuth, obj: dict[str, Any], parent: Any = None
) -> DomoPublication_Content:
    """Build publication content from a publication ``children`` entry.

    Args:
        auth: Authenticated Domo session.
        obj: One entry of the publication's ``children`` list.
        parent: The owning publication, if known.

    Returns:
        The publication content entity.
    """
    entity_type = obj.get("content").get("type")
    return cls(
        auth=auth,
        content_id=obj["id"],
        entity_id=obj.get("content").get("domoObjectId"),
        entity_domain=obj.get("content").get("domain"),
        is_v2=obj.get("isV2"),
        created_dt=(
            dt.datetime.fromtimestamp(obj["created"] / 1000)
            if obj["created"]
            else None
        ),
        updated_dt=(
            dt.datetime.fromtimestamp(obj.get("content").get("updated") / 1000)
            if obj.get("content").get("updated")
            else None
        ),
        is_direct_content=obj.get("useDirectContent"),
        parent=parent,
        entity_type=entity_type,
        entity=DomoPublication_Content_Enum[entity_type].value,
    )

get_entity async

get_entity(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> Any

Get the entity behind this publication content.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
Any

The publisher-side entity (card, dataset, page, or data app).

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
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
async def get_entity(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> Any:
    """Get the entity behind this publication content.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The publisher-side entity (card, dataset, page, or data app).
    """
    if not self.entity:
        self.entity = DomoPublication_Content_Enum[self.entity_type].value

    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    self.entity = await self.entity.get_entity_by_id(
        auth=self.auth,
        entity_id=self.entity_id,
        context=context,
    )

    return self.entity

to_api_json

to_api_json() -> dict[str, Any]

Serialize this content for a publish create/update request body.

Returns:

Type Description
dict[str, Any]

The content descriptor expected by the publish API.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
178
179
180
181
182
183
184
185
186
187
188
189
def to_api_json(self) -> dict[str, Any]:
    """Serialize this content for a publish create/update request body.

    Returns:
        The content descriptor expected by the publish API.
    """
    return {
        "domain": self.entity_domain,
        "domoObjectId": self.entity_id,
        "customerId": self.entity_domain,
        "type": self.entity_type,
    }

DomoPublication_Content_Enum

Bases: DomoEnumMixin, Enum

Maps a publication content type name to the entity class that models it.

DomoPublication_UnexpectedContentType

DomoPublication_UnexpectedContentType(
    cls_instance: Any, content_type: str
)

Bases: ClassError

Raised when a publication holds a content type the library does not model.

Build the error for an unexpected content type.

Parameters:

Name Type Description Default
cls_instance Any

The publication that holds the content.

required
content_type str

The unrecognized content type name.

required
Source code in src/crew_dcs/classes/DomoEverywhere/core.py
195
196
197
198
199
200
201
202
203
204
205
def __init__(self, cls_instance: Any, content_type: str) -> None:
    """Build the error for an unexpected content type.

    Args:
        cls_instance: The publication that holds the content.
        content_type: The unrecognized content type name.
    """
    super().__init__(
        cls_instance=cls_instance,
        message=f"DomoPublication_Instantiation: Unexpected content type {content_type}",
    )

DomoSubscription dataclass

DomoSubscription(
    auth: DomoAuth,
    id: str,
    raw: dict,
    publication_id: str,
    subscriber_domain: str,
    publisher_domain: str,
    parent_publication: DomoPublication = None,
    created_dt: datetime | None = None,
    _name: str | None = None,
)

Bases: DomoEntity_w_Lineage

A subscription: an instance that a publication is sent to.

display_url property

display_url: str

URL of the subscriptions page in the Domo admin UI.

name property

name: str

Get subscription name.

Priority: 1. Name from API response (if available) 2. Parent publication name (no extra API call if already loaded) 3. Fallback to "Subscription"

from_dict classmethod

from_dict(
    auth: DomoAuth,
    obj: dict[str, Any],
    parent_publication: Any = None,
) -> DomoSubscription

Build a subscription from an API payload.

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session.

required
obj dict[str, Any]

The subscription payload.

required
parent_publication Any

The owning publication, if known.

None

Returns:

Type Description
DomoSubscription

The subscription entity.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
@classmethod
def from_dict(
    cls, auth: DomoAuth, obj: dict[str, Any], parent_publication: Any = None
) -> DomoSubscription:
    """Build a subscription from an API payload.

    Args:
        auth: Authenticated Domo session.
        obj: The subscription payload.
        parent_publication: The owning publication, if known.

    Returns:
        The subscription entity.
    """
    return cls(
        auth=auth,
        id=obj.get("id") or obj.get("subscriptionId"),
        publication_id=obj["publicationId"],
        subscriber_domain=obj.get("domain") or obj.get("subscriberDomain"),
        publisher_domain=obj.get("publisherDomain"),
        created_dt=(
            (dt.datetime.fromtimestamp(obj.get("created") / 1000))
            if obj.get("created")
            else None
        ),
        _name=obj.get("name"),  # Extract name from API if available
        raw=obj,
        parent_publication=parent_publication,
    )

get_by_id async classmethod

get_by_id(
    auth: DomoAuth,
    subscription_id: str,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> DomoSubscription | ResponseGetData

Get a subscription by ID.

Parameters:

Name Type Description Default
auth DomoAuth

Authenticated Domo session.

required
subscription_id str

Subscription ID.

required
return_raw bool

If True, return the raw response instead of an entity.

False
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
DomoSubscription | ResponseGetData

The subscription, or the raw response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
@classmethod
async def get_by_id(
    cls,
    auth: DomoAuth,
    subscription_id: str,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> DomoSubscription | rgd.ResponseGetData:
    """Get a subscription by ID.

    Args:
        auth: Authenticated Domo session.
        subscription_id: Subscription ID.
        return_raw: If True, return the raw response instead of an entity.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The subscription, or the raw response when ``return_raw`` is True.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    res = await publish_routes.get_subscription_by_id(
        auth=auth,
        subscription_id=subscription_id,
        context=context,
    )

    if return_raw:
        return res

    return cls.from_dict(auth=auth, obj=res.response)

get_content_details async

get_content_details(
    parent_auth: DomoAuth | None = None,
    parent_auth_retrieval_fn: Callable | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> list[DomoPublication_Content]

Map the parent publication's content to this subscriber's copies.

Parameters:

Name Type Description Default
parent_auth DomoAuth | None

Auth for the publisher instance.

None
parent_auth_retrieval_fn Callable | None

Callable returning publisher auth given the publisher domain; used when parent_auth is omitted.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
list[DomoPublication_Content]

The publication content, updated with subscriber-side IDs.

Raises:

Type Description
DomoSubscription_NoParent

If the parent publication cannot be retrieved.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
async def get_content_details(
    self,
    parent_auth: DomoAuth | None = None,
    parent_auth_retrieval_fn: Callable | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> list[DomoPublication_Content]:
    """Map the parent publication's content to this subscriber's copies.

    Args:
        parent_auth: Auth for the publisher instance.
        parent_auth_retrieval_fn: Callable returning publisher auth given the
            publisher domain; used when ``parent_auth`` is omitted.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The publication content, updated with subscriber-side IDs.

    Raises:
        DomoSubscription_NoParent: If the parent publication cannot be retrieved.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    if not self.parent_publication:
        await self.get_parent_publication(
            parent_auth=parent_auth,
            parent_auth_retrieval_fn=parent_auth_retrieval_fn,
            context=context,
        )

    if not self.parent_publication:
        raise DomoSubscription_NoParent(self)

    publication_content = self.parent_publication.content

    res = await publish_routes.get_subscriber_content_details(
        auth=self.parent_publication.auth,
        publication_id=self.publication_id,
        subscriber_instance=self.subscriber_domain,
        context=context,
    )

    for content in publication_content:
        subscriber_obj = next(
            (
                subscriber_obj
                for subscriber_obj in res.response
                if subscriber_obj["publisherObjectId"] == content.entity_id
                and subscriber_obj["contentType"] == content.entity_type
            ),
            None,
        )
        if subscriber_obj is not None:
            content.subscriber_content_id = subscriber_obj["subscriberObjectId"]
            content.subscriber_insance = subscriber_obj["subscriberDomain"]

    # Return the updated publication content
    return publication_content

get_entity_by_id async classmethod

get_entity_by_id(
    entity_id: str, auth: DomoAuth, **kwargs: Any
) -> DomoSubscription | ResponseGetData

Get a subscription by ID (generic entity entry point).

Parameters:

Name Type Description Default
entity_id str

Subscription ID.

required
auth DomoAuth

Authenticated Domo session.

required
**kwargs Any

Forwarded to get_by_id.

{}

Returns:

Type Description
DomoSubscription | ResponseGetData

The subscription, or the raw response when return_raw is True.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
@classmethod
async def get_entity_by_id(
    cls, entity_id: str, auth: DomoAuth, **kwargs: Any
) -> DomoSubscription | rgd.ResponseGetData:
    """Get a subscription by ID (generic entity entry point).

    Args:
        entity_id: Subscription ID.
        auth: Authenticated Domo session.
        **kwargs: Forwarded to ``get_by_id``.

    Returns:
        The subscription, or the raw response when ``return_raw`` is True.
    """
    return await cls.get_by_id(subscription_id=entity_id, auth=auth, **kwargs)

get_parent_publication async

get_parent_publication(
    parent_auth: DomoAuth | None = None,
    parent_auth_retrieval_fn: Callable | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> DomoPublication

Get the publication this subscription belongs to.

Parameters:

Name Type Description Default
parent_auth DomoAuth | None

Auth for the publisher instance.

None
parent_auth_retrieval_fn Callable | None

Callable returning publisher auth given the publisher domain (sync or async); used when parent_auth is omitted.

None
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
DomoPublication

The parent publication (also stored on parent_publication).

Raises:

Type Description
DomoSubscription_NoParentAuth

If no publisher auth can be resolved.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
async def get_parent_publication(
    self,
    parent_auth: DomoAuth | None = None,
    parent_auth_retrieval_fn: Callable | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> DomoPublication:
    """Get the publication this subscription belongs to.

    Args:
        parent_auth: Auth for the publisher instance.
        parent_auth_retrieval_fn: Callable returning publisher auth given the
            publisher domain (sync or async); used when ``parent_auth`` is omitted.
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The parent publication (also stored on ``parent_publication``).

    Raises:
        DomoSubscription_NoParentAuth: If no publisher auth can be resolved.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    if not parent_auth and parent_auth_retrieval_fn:
        auth_or_coro = parent_auth_retrieval_fn(self.publisher_domain)
        if inspect.isawaitable(auth_or_coro):
            parent_auth = await auth_or_coro  # type: ignore[assignment]
        else:
            parent_auth = auth_or_coro

    if not parent_auth:
        raise DomoSubscription_NoParentAuth(self)

    self.parent_publication = await DomoPublication.get_by_id(
        publication_id=self.publication_id,
        auth=parent_auth,
        context=context,
    )

    return self.parent_publication

get_share async

get_share(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get this subscription's share.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
async def get_share(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get this subscription's share.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    return await publish_subscription_routes.get_subscription_share(
        auth=self.auth,
        subscription_id=self.id,
        context=context,
    )

get_share_groups async

get_share_groups(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get the groups this subscription is shared with.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
async def get_share_groups(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get the groups this subscription is shared with.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    return await publish_subscription_routes.get_subscription_share_groups(
        auth=self.auth,
        subscription_id=self.id,
        context=context,
    )

get_with_share async

get_with_share(
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any
) -> ResponseGetData

Get this subscription together with its share.

Parameters:

Name Type Description Default
context RouteContext | None

Optional pre-built route context.

None
**context_kwargs Any

Extra context overrides.

{}

Returns:

Type Description
ResponseGetData

The API response.

Source code in src/crew_dcs/classes/DomoEverywhere/core.py
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
async def get_with_share(
    self,
    *,
    context: RouteContext | None = None,
    **context_kwargs: Any,
) -> rgd.ResponseGetData:
    """Get this subscription together with its share.

    Args:
        context: Optional pre-built route context.
        **context_kwargs: Extra context overrides.

    Returns:
        The API response.
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    return await publish_subscription_routes.get_subscription_with_share(
        auth=self.auth,
        subscription_id=self.id,
        context=context,
    )

DomoSubscription_NoParent

DomoSubscription_NoParent(cls_instance: Any)

Bases: ClassError

Raised when a subscription's parent publication cannot be retrieved.

Build the error for a subscription with no retrievable parent.

Parameters:

Name Type Description Default
cls_instance Any

The subscription whose parent publication is missing.

required
Source code in src/crew_dcs/classes/DomoEverywhere/core.py
58
59
60
61
62
63
64
65
66
67
68
def __init__(self, cls_instance: Any) -> None:
    """Build the error for a subscription with no retrievable parent.

    Args:
        cls_instance: The subscription whose parent publication is missing.
    """
    super().__init__(
        cls_instance=cls_instance,
        entity_id="subscription_id",
        message="unable to retrieve parent publication",
    )

DomoSubscription_NoParentAuth

DomoSubscription_NoParentAuth(cls_instance: Any)

Bases: ClassError

Raised when a subscription has no parent-instance auth to reach its publication.

Build the error for a subscription that lacks parent auth.

Parameters:

Name Type Description Default
cls_instance Any

The subscription that needs parent auth.

required
Source code in src/crew_dcs/classes/DomoEverywhere/core.py
42
43
44
45
46
47
48
49
50
51
52
def __init__(self, cls_instance: Any) -> None:
    """Build the error for a subscription that lacks parent auth.

    Args:
        cls_instance: The subscription that needs parent auth.
    """
    super().__init__(
        cls_instance=cls_instance,
        entity_id="subscription_id",
        message="must pass parent_auth or parent_auth_retrieval_fn which returns an instance of auth given self",
    )