# 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 ExternalAuthCompleteResponse:
    """External Auth Complete Response model."""

    redirect_uri: str
    """URI to redirect the user back to AuthKit to complete the OAuth flow."""

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

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