# 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 DataIntegrationAuthorizeUrlResponse:
    """Data Integration Authorize Url Response model."""

    url: str
    """The OAuth authorization URL to redirect the user to."""

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

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