core
core ¶
DomoVariable — a Domo dashboard variable (a function template with variable=True).
Variables share Domo's Functions API with beast modes (folder "Functions
(Beast Modes and Variables)"). A variable IS a function template whose
variable flag is true; it carries a name, a data type, and links to the
cards/datasets it is used on. On a page, a variable is surfaced through a
VARIABLE layout slot that references a variable control (see
DomoVariableControl) — the control is the on-page widget, this is the
underlying definition.
DomoVariable
dataclass
¶
DomoVariable(
auth: DomoAuth,
id: str,
raw: dict,
name: str = "",
data_type: str = "STRING",
is_global: bool = False,
locked: bool = False,
legacy_id: str = "",
)
Bases: DomoEntity
A Domo variable (function template with variable=True).
Usage
variables = await DomoVariables(auth=auth).search() v = await DomoVariable.get_by_id(auth=auth, id="100") print(v.name, v.data_type)
from_dict
classmethod
¶
from_dict(
auth: DomoAuth, obj: dict[str, Any]
) -> DomoVariable
Build a DomoVariable from a functions/search or functions/template response.
Source code in src/crew_dcs/classes/DomoVariable/core.py
47 48 49 50 51 52 53 54 55 56 57 58 59 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoVariable
Retrieve a single variable (function template) by id.
Source code in src/crew_dcs/classes/DomoVariable/core.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
get_entity_by_id
async
classmethod
¶
get_entity_by_id(
entity_id: str, auth: DomoAuth, **kwargs: Any
) -> DomoVariable
Internal wrapper used by the base refresh() machinery.
Source code in src/crew_dcs/classes/DomoVariable/core.py
77 78 79 80 81 82 | |
DomoVariables
dataclass
¶
DomoVariables(auth: DomoAuth)
Manager for searching and listing Domo variables.
Usage
variables = await DomoVariables(auth=auth).search() named = await DomoVariables(auth=auth).search(name="Choose metric")
search
async
¶
search(
name: str | None = None,
filters: list[dict] | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoVariable]
Search for variables across the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Optional variable name to filter by. |
None
|
filters
|
list[dict] | None
|
Optional extra filter dictionaries. |
None
|
context
|
RouteContext | None
|
Optional RouteContext for request configuration. |
None
|
Returns:
| Type | Description |
|---|---|
list[DomoVariable]
|
List of DomoVariable instances. |
Source code in src/crew_dcs/classes/DomoVariable/core.py
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 | |