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

from __future__ import annotations

from dataclasses import dataclass
from typing import Any

from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class SendEmailChange:
    """Send Email Change model."""

    new_email: str
    """The new email address to change to."""

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

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