# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["OAuthConnectionRetrieveResponse"]


class OAuthConnectionRetrieveResponse(BaseModel):
    id: str
    """Connection ID"""

    account_identifier: Optional[str] = FieldInfo(alias="accountIdentifier", default=None)
    """Account identifier (e.g. email)"""

    created_at: str = FieldInfo(alias="createdAt")
    """Creation timestamp"""

    is_default: bool = FieldInfo(alias="isDefault")
    """Whether this is the default connection for its provider"""

    label: Optional[str] = None
    """Optional display label"""

    last_used_at: Optional[str] = FieldInfo(alias="lastUsedAt", default=None)
    """Last used timestamp"""

    provider_id: str = FieldInfo(alias="providerId")
    """Provider ID"""

    provider_name: str = FieldInfo(alias="providerName")
    """Provider display name"""

    provider_slug: str = FieldInfo(alias="providerSlug")
    """Provider slug"""

    scopes: Optional[str] = None
    """Granted scopes"""

    slug: Optional[str] = None
    """Connection name (slug)"""

    status: str
    """Connection status"""

    token_type: str = FieldInfo(alias="tokenType")
    """Token type (e.g. Bearer)"""
