Skip to content

manager

manager

DomoBeastModes manager for searching and listing beast modes.

Provides collection-level operations: search, get by dataset, get by card.

DomoBeastModes dataclass

DomoBeastModes(auth: DomoAuth)

Manager for searching and listing beast modes.

Usage

bms = DomoBeastModes(auth=auth) results = await bms.search() dataset_bms = await bms.get_by_dataset(dataset_id="abc-123") card_bms = await bms.get_by_card(card_id="456")

get_by_card async

get_by_card(
    card_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoBeastMode]

Get beast modes associated with a card.

Searches all beast modes and filters for those linked to the given card.

Parameters:

Name Type Description Default
card_id str

The card ID to filter by

required
context RouteContext | None

Optional RouteContext for request configuration

None

Returns:

Type Description
list[DomoBeastMode]

List of DomoBeastMode instances linked to the card

Source code in src/crew_dcs/classes/DomoBeastMode/manager.py
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
async def get_by_card(
    self,
    card_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoBeastMode]:
    """Get beast modes associated with a card.

    Searches all beast modes and filters for those linked to the given card.

    Args:
        card_id: The card ID to filter by
        context: Optional RouteContext for request configuration

    Returns:
        List of DomoBeastMode instances linked to the card
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    res = await beastmode_routes.search_beastmodes(
        auth=self.auth,
        context=context,
    )

    if not res.is_success:
        return []

    all_bms = res.response
    filter_bms = [
        bm
        for bm in all_bms
        if any(
            link.get("resource", {}).get("type") == "CARD"
            and link.get("resource", {}).get("id") == card_id
            for link in bm.get("links", [])
        )
    ]

    return [DomoBeastMode.from_dict(auth=self.auth, obj=bm) for bm in filter_bms]

get_by_dataset async

get_by_dataset(
    dataset_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoBeastMode]

Get beast modes associated with a dataset.

Searches all beast modes and filters for those linked to the given dataset.

Parameters:

Name Type Description Default
dataset_id str

The dataset ID to filter by

required
context RouteContext | None

Optional RouteContext for request configuration

None

Returns:

Type Description
list[DomoBeastMode]

List of DomoBeastMode instances linked to the dataset

Source code in src/crew_dcs/classes/DomoBeastMode/manager.py
60
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
async def get_by_dataset(
    self,
    dataset_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoBeastMode]:
    """Get beast modes associated with a dataset.

    Searches all beast modes and filters for those linked to the given dataset.

    Args:
        dataset_id: The dataset ID to filter by
        context: Optional RouteContext for request configuration

    Returns:
        List of DomoBeastMode instances linked to the dataset
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    res = await beastmode_routes.search_beastmodes(
        auth=self.auth,
        context=context,
    )

    if not res.is_success:
        return []

    all_bms = res.response
    filter_bms = [
        bm
        for bm in all_bms
        if any(
            link.get("resource", {}).get("type") == "DATA_SOURCE"
            and link.get("resource", {}).get("id") == dataset_id
            for link in bm.get("links", [])
        )
    ]

    return [DomoBeastMode.from_dict(auth=self.auth, obj=bm) for bm in filter_bms]

get_by_page async

get_by_page(
    page_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoBeastMode]

Get beast modes associated with a page.

Retrieves all beast modes linked to cards on the given page.

Parameters:

Name Type Description Default
page_id str

The page ID to retrieve beast modes for

required
context RouteContext | None

Optional RouteContext for request configuration

None

Returns:

Type Description
list[DomoBeastMode]

List of DomoBeastMode instances linked to cards on the page

Source code in src/crew_dcs/classes/DomoBeastMode/manager.py
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
async def get_by_page(
    self,
    page_id: str,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoBeastMode]:
    """Get beast modes associated with a page.

    Retrieves all beast modes linked to cards on the given page.

    Args:
        page_id: The page ID to retrieve beast modes for
        context: Optional RouteContext for request configuration

    Returns:
        List of DomoBeastMode instances linked to cards on the page
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    raw_list = await beastmode_routes.get_page_beastmodes(
        page_id=page_id,
        auth=self.auth,
        context=context,
    )

    return [DomoBeastMode.from_dict(auth=self.auth, obj=bm) for bm in raw_list]

search async

search(
    filters: list[dict] | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoBeastMode]

Search for beast modes with optional filters.

Parameters:

Name Type Description Default
filters list[dict] | None

Optional list of filter dictionaries

None
context RouteContext | None

Optional RouteContext for request configuration

None

Returns:

Type Description
list[DomoBeastMode]

List of DomoBeastMode instances

Source code in src/crew_dcs/classes/DomoBeastMode/manager.py
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
async def search(
    self,
    filters: list[dict] | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoBeastMode]:
    """Search for beast modes with optional filters.

    Args:
        filters: Optional list of filter dictionaries
        context: Optional RouteContext for request configuration

    Returns:
        List of DomoBeastMode instances
    """
    context = RouteContext.build_context(context=context, **context_kwargs)

    res = await beastmode_routes.search_beastmodes(
        auth=self.auth,
        filters=filters,
        context=context,
    )

    if not res.is_success:
        return []

    return [DomoBeastMode.from_dict(auth=self.auth, obj=bm) for bm in res.response]