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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata


class McpConfigurationResponse(UniversalBaseModel):
    """
    Response schema for MCP configuration.
    """

    id: str = pydantic.Field()
    """
    MCP configuration ID
    """

    name: str = pydantic.Field()
    """
    Display name
    """

    type: str = pydantic.Field()
    """
    MCP type
    """

    organization_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="organizationId"),
        pydantic.Field(alias="organizationId", description="Organization ID"),
    ]
    user_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="userId"),
        pydantic.Field(alias="userId", description="User ID (for personal MCPs)"),
    ] = None
    server_url: typing_extensions.Annotated[
        str, FieldMetadata(alias="serverUrl"), pydantic.Field(alias="serverUrl", description="MCP server URL")
    ]
    transport_type: typing_extensions.Annotated[
        str, FieldMetadata(alias="transportType"), pydantic.Field(alias="transportType", description="Transport type")
    ]
    auth_type: typing_extensions.Annotated[
        str, FieldMetadata(alias="authType"), pydantic.Field(alias="authType", description="Authentication type")
    ]
    is_active: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isActive"),
        pydantic.Field(alias="isActive", description="Whether configuration is active"),
    ]
    connection_status: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="connectionStatus"),
        pydantic.Field(alias="connectionStatus", description="Connection status"),
    ]
    last_connected_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastConnectedAt"),
        pydantic.Field(alias="lastConnectedAt", description="Last successful connection timestamp"),
    ] = None
    error_message: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="errorMessage"),
        pydantic.Field(alias="errorMessage", description="Last error message"),
    ] = None
    created_at: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="createdAt"),
        pydantic.Field(alias="createdAt", description="Creation timestamp"),
    ]
    updated_at: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="updatedAt"),
        pydantic.Field(alias="updatedAt", description="Last update timestamp"),
    ]

    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
