Skip to content

domo

domo

Domo-specific account configurations.

DomoAccount_Config_AbstractCredential dataclass

DomoAccount_Config_AbstractCredential(
    data_provider_type: str = "abstract-credential-store",
    is_oauth: bool = False,
    allow_external_use: bool = True,
    parent: Any = None,
    raw: dict = None,
    credentials: dict = None,
)

Bases: DomoAccount_Config

Abstract credential store — stores arbitrary key-value credentials.

The Domo API expects the credentials field as a JSON string, not a dict. This class handles the serialization/deserialization transparently so callers can work with a plain Python dict.

from_dict classmethod

from_dict(obj, parent=None, **kwargs)

Parse the API response, converting credentials string to dict.

Source code in src/crew_dcs/classes/DomoAccount/account_configs/domo.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@classmethod
def from_dict(cls, obj, parent=None, **kwargs):
    """Parse the API response, converting credentials string to dict."""
    raw_creds = obj.get("credentials")
    if isinstance(raw_creds, str):
        # keep as-is if not parseable (e.g. masked)
        with contextlib.suppress(json.JSONDecodeError, TypeError):
            raw_creds = json.loads(raw_creds)

    return cls(
        parent=parent,
        raw=obj,
        credentials=raw_creds,
        **{
            k: v
            for k, v in kwargs.items()
            if k not in ["credentials", "raw", "parent"]
        },
    )

to_dict

to_dict(**kwargs) -> dict

Serialize to API format — credentials as JSON string.

Source code in src/crew_dcs/classes/DomoAccount/account_configs/domo.py
58
59
60
61
62
63
def to_dict(self, **kwargs) -> dict:
    """Serialize to API format — credentials as JSON string."""
    result = {"allowExternalUse": self.allow_external_use}
    if self.credentials is not None:
        result["credentials"] = json.dumps(self.credentials)
    return result