"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from datetime import datetime
from enum import Enum
from panora_sdk.types import BaseModel
from typing import TypedDict


class TokenType(str, Enum):
    r"""Strategy type"""

    OAUTH2 = "oauth2"
    APIKEY = "apikey"
    BASIC = "basic"


class ConnectionTypedDict(TypedDict):
    id_connection: str
    r"""Unique identifier for the connection"""
    status: str
    r"""Status of the connection"""
    provider_slug: str
    r"""Slug for the provider"""
    vertical: str
    r"""Vertical category of the connection"""
    account_url: str
    r"""URL of the account"""
    token_type: TokenType
    r"""Strategy type"""
    access_token: str
    r"""Access token for the connection"""
    refresh_token: str
    r"""Refresh token for the connection"""
    expiration_timestamp: datetime
    r"""Expiration timestamp of the access token"""
    created_at: datetime
    r"""Timestamp when the connection was created"""
    connection_token: str
    r"""UUID Token for the connection"""
    id_project: str
    r"""Project ID associated with the connection"""
    id_linked_user: str
    r"""Linked user ID associated with the connection"""


class Connection(BaseModel):
    id_connection: str
    r"""Unique identifier for the connection"""

    status: str
    r"""Status of the connection"""

    provider_slug: str
    r"""Slug for the provider"""

    vertical: str
    r"""Vertical category of the connection"""

    account_url: str
    r"""URL of the account"""

    token_type: TokenType
    r"""Strategy type"""

    access_token: str
    r"""Access token for the connection"""

    refresh_token: str
    r"""Refresh token for the connection"""

    expiration_timestamp: datetime
    r"""Expiration timestamp of the access token"""

    created_at: datetime
    r"""Timestamp when the connection was created"""

    connection_token: str
    r"""UUID Token for the connection"""

    id_project: str
    r"""Project ID associated with the connection"""

    id_linked_user: str
    r"""Linked user ID associated with the connection"""
