dograh/api/services/telephony/providers/telnyx/config.py
Abhishek 7fd3b96470
feat: agent stream for cloudonix OPBX (#261)
* feat: agent stream for cloudonix OPBX

* feat: make cloudonix app name optional

* feat: create application while configuring telephony config

* fix: get telephony configuration from stamped workflow run

* fix: fix vobiz hangup URL
2026-05-02 15:53:58 +05:30

34 lines
1.2 KiB
Python

"""Telnyx telephony configuration schemas."""
from typing import List, Literal, Optional
from pydantic import BaseModel, Field
class TelnyxConfigurationRequest(BaseModel):
"""Request schema for Telnyx configuration."""
provider: Literal["telnyx"] = Field(default="telnyx")
api_key: str = Field(..., description="Telnyx API Key")
connection_id: Optional[str] = Field(
default=None,
description=(
"Telnyx Call Control Application ID (connection_id). If omitted, "
"a Call Control Application is auto-created on save and its id is "
"stored on the configuration."
),
)
# Phone numbers are managed via the dedicated phone-numbers endpoints; the
# legacy /telephony-config POST shim still accepts them inline.
from_numbers: List[str] = Field(
default_factory=list, description="List of Telnyx phone numbers"
)
class TelnyxConfigurationResponse(BaseModel):
"""Response schema for Telnyx configuration with masked sensitive fields."""
provider: Literal["telnyx"] = Field(default="telnyx")
api_key: str # Masked
connection_id: Optional[str] = None
from_numbers: List[str]