Skip to content

pages

pages

Page management and collection operations.

DomoPages dataclass

DomoPages(auth: DomoAuth, pages: list[Any] = None)

get async

get(**kwargs)

calls get_admin_summary to retrieve all pages in an instance

Source code in src/crew_dcs/classes/DomoPage/pages.py
21
22
23
async def get(self, **kwargs):
    """calls get_admin_summary to retrieve all pages in an instance"""
    return await self.get_admin_summary(**kwargs)

get_admin_summary async

get_admin_summary(
    search_title: str | None = None,
    parent_page_id: int | None = None,
    return_raw: bool = False,
    debug_api: bool = False,
    session: AsyncClient = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
)

use admin_summary to retrieve all pages in an instance -- regardless of user access NOTE: some Page APIs will not return results if page access isn't explicitly shared

Source code in src/crew_dcs/classes/DomoPage/pages.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
async def get_admin_summary(
    self,
    search_title: str | None = None,
    parent_page_id: int | None = None,
    return_raw: bool = False,
    debug_api: bool = False,
    session: httpx.AsyncClient = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
):
    """use admin_summary to retrieve all pages in an instance -- regardless of user access
    NOTE: some Page APIs will not return results if page access isn't explicitly shared
    """
    from .core import DomoPage

    # DomoPages doesn't extend DomoManager, so use RouteContext.build_context directly
    # and merge with context_kwargs
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )

    res = await page_routes.get_pages_adminsummary(
        auth=self.auth,
        context=context,
        search_title=search_title,
        page_parent_id=parent_page_id,
    )

    if return_raw:
        return res

    self.pages = await dmce.gather_with_concurrency(
        n=60,
        *[  # noqa: B026
            DomoPage._from_adminsummary(
                page_obj, auth=self.auth, debug_api=debug_api, session=session
            )
            for page_obj in res.response
        ],
    )

    return self.pages