DomoObjective
DomoObjective ¶
DomoObjective Package
Class-based approach for interacting with Domo Goals (Objectives), key results, and objective tags.
Modules:
| Name | Description |
|---|---|
core |
DomoObjective entity and DomoObjectives manager |
key_result |
DomoKeyResult and DomoKeyResults sub-entity |
tag |
DomoObjectiveTag and DomoObjectiveTags sub-entity |
DomoKeyResult
dataclass
¶
DomoKeyResult(
id: int,
name: str = None,
description: str = None,
state: str = None,
status: str = None,
owner_id: int = None,
owner_type: str = None,
owners: list[Any] = None,
resource_id: str = None,
resource_type: str = None,
measurement: str = None,
start_value: float = None,
current_value: float = None,
target_value: float = None,
color_value: str = None,
operator: str = None,
raw: dict = None,
)
Represents a single key result belonging to an objective.
DomoKeyResults
dataclass
¶
DomoKeyResults(
parent: DomoEntity,
key_results: list[DomoKeyResult] = list(),
)
Bases: DomoSubEntity
Sub-entity for managing an objective's key results.
create
async
¶
create(
name: str,
owner_id: int,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoKeyResult
Create a new key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
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 | |
delete
async
¶
delete(
key_result_id: int | str,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Delete a key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
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 | |
get
async
¶
get(
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoKeyResult]
Populate key results from the parent objective's raw data.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
get_chart
async
¶
get_chart(
key_result_id: int | str,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Get chart data for a key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
get_values
async
¶
get_values(
key_result_id: int | str,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Get historical values for a key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
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(
key_result_id: int | str,
payload: dict,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoKeyResult
Update an existing key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
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 | |
update_tags
async
¶
update_tags(
key_result_id: int | str,
tag_ids: list[int],
period_id: int | None = None,
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Replace the tags assigned to a key result.
Source code in src/crew_dcs/classes/DomoObjective/key_result.py
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 | |
DomoObjective
dataclass
¶
DomoObjective(
auth: DomoAuth,
id: int,
raw: dict,
name: str = None,
description: str = None,
starts_at: Any = None,
expires_at: Any = None,
status: str = None,
owner_id: int = None,
owners: list[Any] = None,
assignees: list[Any] = None,
period_id: int = None,
parent_id: int = None,
tags: list[Any] = None,
write_access: bool = None,
type: str = None,
)
Bases: DomoEntity
Represents a Domo Goal/Objective.
create
async
classmethod
¶
create(
auth: DomoAuth,
name: str,
period_id: int,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoObjective
Create a new objective.
Source code in src/crew_dcs/classes/DomoObjective/core.py
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 | |
delete
async
¶
delete(
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Delete this objective.
Source code in src/crew_dcs/classes/DomoObjective/core.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
from_dict
classmethod
¶
from_dict(
auth: DomoAuth, obj: dict[str, Any], **kwargs
) -> DomoObjective
Converts an objectives API response into a DomoObjective instance.
Source code in src/crew_dcs/classes/DomoObjective/core.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
objective_id: int | str,
period_id: int | None = None,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoObjective
Retrieve a single objective by ID.
The Goals API does not expose a dedicated "get objective by id" endpoint, so this searches all objectives and matches by ID.
Source code in src/crew_dcs/classes/DomoObjective/core.py
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 | |
get_entity_by_id
async
classmethod
¶
get_entity_by_id(entity_id, **kwargs) -> DomoObjective
Alias for get_by_id.
Source code in src/crew_dcs/classes/DomoObjective/core.py
135 136 137 138 | |
update
async
¶
update(
payload: dict | None = None,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoObjective
Update this objective.
Source code in src/crew_dcs/classes/DomoObjective/core.py
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
DomoObjective_NoMatchError ¶
DomoObjective_NoMatchError(
objective_id, domo_instance, **kwargs
)
Bases: ClassError
Raised when a specific objective cannot be found.
Source code in src/crew_dcs/classes/DomoObjective/core.py
25 26 27 28 29 30 31 | |
DomoObjectives
dataclass
¶
DomoObjectives(
auth: DomoAuth, objectives: list[DomoObjective] = None
)
Bases: DomoManager
Manager for retrieving collections of objectives.
get
async
¶
get(
period_id: int | None = None,
filter_key_results: bool = False,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoObjective]
Search for objectives.
Source code in src/crew_dcs/classes/DomoObjective/core.py
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 | |