from pydantic import BaseModel
from typing import Literal, Dict


class AgentData(BaseModel):
    idFatura: str | None = None
    current_invoice_number: str | None = None
    currentInvoiceNumber: str | None = None
    channel: str | None = None


class StartData(BaseModel):
    agent: str
    ani: str
    gsm: str
    routerCallKeyDay: str
    routerCallKey: str
    callIdGed: str
    session_id: str
    sessionId: str | None = None
    protocolo: str | None = None
    agentData: AgentData | None = None


class AudioFormat(BaseModel):
    encoding: str
    sampleRateHz: int
    channels: int

class StartMessage(BaseModel):
    type: Literal["start"]
    data: StartData
    audioFormat: Dict[str, object] | AudioFormat | None = None
    callConfig: Dict[str, object] | None = None

class StopMessage(BaseModel):
    type: Literal["stop"]


class TransferenciaSessionIdData(BaseModel):
    session_id: str


class TransferenciaSessionIdMessage(BaseModel):
    type: Literal["transferencia_session_id"]
    data: TransferenciaSessionIdData
