Skip to content

tag

tag

DomoObjectiveTag dataclass

DomoObjectiveTag(
    id: int,
    name: str = None,
    category: dict[str, Any] = None,
    raw: dict = None,
)

Represents a single objective tag.

DomoObjectiveTags dataclass

DomoObjectiveTags(
    parent: DomoEntity,
    tags: list[DomoObjectiveTag] = list(),
)

Bases: DomoSubEntity

Sub-entity for managing an objective's assigned tags.

create async staticmethod

create(
    auth,
    name: str,
    category_id: int | None = None,
    category_name: str | None = None,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> DomoObjectiveTag

Create a new objective tag.

Source code in src/crew_dcs/classes/DomoObjective/tag.py
 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
@staticmethod
async def create(
    auth,
    name: str,
    category_id: int | None = None,
    category_name: str | None = None,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> DomoObjectiveTag:
    """Create a new objective tag."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    res = await objectives_routes.create_tag(
        auth=auth,
        name=name,
        category_id=category_id,
        category_name=category_name,
        context=context,
    )

    if return_raw:
        return res

    return DomoObjectiveTag.from_dict(res.response)

delete async staticmethod

delete(
    auth,
    tag_id: int | str,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
)

Delete an objective tag.

Source code in src/crew_dcs/classes/DomoObjective/tag.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@staticmethod
async def delete(
    auth,
    tag_id: int | str,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
):
    """Delete an objective tag."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    return await objectives_routes.delete_tag(
        auth=auth,
        tag_id=tag_id,
        context=context,
    )

get async

get(
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoObjectiveTag]

Populate tags from the parent objective's raw data.

Source code in src/crew_dcs/classes/DomoObjective/tag.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
async def get(
    self,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoObjectiveTag]:
    """Populate tags from the parent objective's raw data."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    raw = getattr(self.parent, "raw", None) or {}
    self.tags = [DomoObjectiveTag.from_dict(obj) for obj in raw.get("tags", [])]
    return self.tags

list_all async staticmethod

list_all(
    auth,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoObjectiveTag]

List every tag available in the Goals product (not just this objective's).

Source code in src/crew_dcs/classes/DomoObjective/tag.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@staticmethod
async def list_all(
    auth,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoObjectiveTag]:
    """List every tag available in the Goals product (not just this objective's)."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    res = await objectives_routes.get_tags(auth=auth, context=context)
    return [DomoObjectiveTag.from_dict(obj) for obj in res.response]

update async staticmethod

update(
    auth,
    tag_id: int | str,
    payload: dict,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> DomoObjectiveTag

Update an existing objective tag.

Source code in src/crew_dcs/classes/DomoObjective/tag.py
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
@staticmethod
async def update(
    auth,
    tag_id: int | str,
    payload: dict,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> DomoObjectiveTag:
    """Update an existing objective tag."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    res = await objectives_routes.update_tag(
        auth=auth,
        tag_id=tag_id,
        payload=payload,
        context=context,
    )

    return DomoObjectiveTag.from_dict(res.response)