# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class ConnectorResponse(UniversalBaseModel):
    """
    Personal connector response.
    """

    connector_id: str = pydantic.Field()
    """
    Connector ID
    """

    connector_type: str = pydantic.Field()
    """
    Connector type
    """

    display_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Display name
    """

    account_email: typing.Optional[str] = pydantic.Field(default=None)
    """
    Connected account email
    """

    is_active: bool = pydantic.Field()
    """
    Whether connector is active
    """

    last_sync_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last sync timestamp
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    mcp_configuration_id: str = pydantic.Field()
    """
    Associated MCP config ID
    """

    icon_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL to tool icon/logo
    """

    app_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Link to the tool's application website
    """

    action_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of tool actions this connector exposes to the AI model.
    """

    warning: typing.Optional[str] = pydantic.Field(default=None)
    """
    Warning message to display in the UI. Null means no warning.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
