# 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 ConnectApplicationOAuthRedirectUris:
    """Connect Application O Auth Redirect Uris model."""

    uri: str
    """The redirect URI for the application."""
    default: bool
    """Whether this is the default redirect URI."""

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

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