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

from __future__ import annotations

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


@dataclass(slots=True)
class FlagRuleUpdatedContextConfiguredTargetUser:
    """Flag Rule Updated Context Configured Target User model."""

    id: str
    """The ID of the user."""
    email: str
    """The email of the user."""

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

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