# This file is auto-generated by oagen. Do not edit.

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict, Literal
from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class DsyncActivatedDataDomain:
    """Dsync Activated Data Domain model."""

    object: Literal["organization_domain"]
    """Distinguishes the organization domain object."""
    id: str
    """Unique identifier of the organization domain."""
    domain: str
    """The domain value."""

    @classmethod
    def from_dict(cls, data: Dict[str, Any]) -> "DsyncActivatedDataDomain":
        """Deserialize from a dictionary."""
        try:
            return cls(
                object=data.get("object", "organization_domain"),
                id=data["id"],
                domain=data["domain"],
            )
        except (KeyError, ValueError) as e:
            _raise_deserialize_error("DsyncActivatedDataDomain", e)

    def to_dict(self) -> Dict[str, Any]:
        """Serialize to a dictionary."""
        result: Dict[str, Any] = {}
        result["object"] = self.object
        result["id"] = self.id
        result["domain"] = self.domain
        return result
