diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 83e7eca6..7bca3aee 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.131.0" + ".": "4.132.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 97e6e39d..c4fdb473 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1039 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-ffde1e24535b84cba3dac4fdf2ef6df0fe07639f3429f606c5256c870fe5e062.yml -openapi_spec_hash: 9d4326316d01d0bd0b1b4fcaa849b80c -config_hash: bc071de39b424ea1ecf205d551ac87cc +configured_endpoints: 1041 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-a5fcd0749eaf183022565d79a8386faaf94fda529abc2d18bc8806de15f920a4.yml +openapi_spec_hash: ba27a057456ddf456a415ef046d806da +config_hash: d117d1cbee49ad6ca09249c2f027a5bf diff --git a/CHANGELOG.md b/CHANGELOG.md index 14050490..46f3076a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 4.132.0 (2026-05-14) + +Full Changelog: [v4.131.0...v4.132.0](https://github.com/team-telnyx/telnyx-python/compare/v4.131.0...v4.132.0) + +### Features + +* Document Conversation Relay ([5cb134d](https://github.com/team-telnyx/telnyx-python/commit/5cb134d1b06a6440f8c128297b93bdadcbfccac8)) +* Fix Conversation Relay expected webhook ([277b46d](https://github.com/team-telnyx/telnyx-python/commit/277b46d020b58b756c7c773079dac0fa08febef3)) + ## 4.131.0 (2026-05-13) Full Changelog: [v4.130.0...v4.131.0](https://github.com/team-telnyx/telnyx-python/compare/v4.130.0...v4.131.0) diff --git a/api.md b/api.md index 4ba498b1..b3415644 100644 --- a/api.md +++ b/api.md @@ -43,7 +43,6 @@ from telnyx.types import ( SimpleSimCard, SubNumberOrderRegulatoryRequirementWithValue, WhatsappTemplateData, - XaiVoiceSettings, ) ``` @@ -572,12 +571,7 @@ Methods: Types: ```python -from telnyx.types import ( - ModelMetadata, - AICreateResponseResponse, - AIRetrieveModelsResponse, - AISummarizeResponse, -) +from telnyx.types import AICreateResponseResponse, AIRetrieveModelsResponse, AISummarizeResponse ``` Methods: @@ -593,8 +587,6 @@ Types: ```python from telnyx.types.ai import ( Assistant, - AssistantIntegration, - AssistantMcpServer, AssistantTool, AssistantsList, AudioVisualizerConfig, @@ -607,7 +599,6 @@ from telnyx.types.ai import ( HangupToolParams, ImportMetadata, InferenceEmbedding, - InferenceEmbeddingInterruptionSettings, InferenceEmbeddingWebhookToolParams, InsightSettings, MessagingSettings, @@ -617,9 +608,7 @@ from telnyx.types.ai import ( PostConversationSettingsReq, PrivacySettings, RetrievalTool, - StartSpeakingPlan, TelephonySettings, - TranscriptionEndpointingPlan, TranscriptionSettings, TranscriptionSettingsConfig, TransferTool, @@ -710,15 +699,7 @@ Methods: Types: ```python -from telnyx.types.ai.assistants import ( - CanaryDeploy, - CanaryDeployResponse, - Clause, - RolloutSlot, - RuleInput, - RuleOutput, - Serve, -) +from telnyx.types.ai.assistants import CanaryDeploy, CanaryDeployResponse ``` Methods: @@ -1453,13 +1434,11 @@ from telnyx.types.calls import ( TelnyxVoiceSettings, TranscriptionConfig, TranscriptionEngineAConfig, - TranscriptionEngineAssemblyaiConfig, TranscriptionEngineAzureConfig, TranscriptionEngineBConfig, TranscriptionEngineDeepgramConfig, TranscriptionEngineGoogleConfig, TranscriptionEngineTelnyxConfig, - TranscriptionEngineXaiConfig, TranscriptionStartRequest, ActionAddAIAssistantMessagesResponse, ActionAnswerResponse, @@ -1480,6 +1459,7 @@ from telnyx.types.calls import ( ActionSendSipInfoResponse, ActionSpeakResponse, ActionStartAIAssistantResponse, + ActionStartConversationRelayResponse, ActionStartForkingResponse, ActionStartNoiseSuppressionResponse, ActionStartPlaybackResponse, @@ -1488,6 +1468,7 @@ from telnyx.types.calls import ( ActionStartStreamingResponse, ActionStartTranscriptionResponse, ActionStopAIAssistantResponse, + ActionStopConversationRelayResponse, ActionStopForkingResponse, ActionStopGatherResponse, ActionStopNoiseSuppressionResponse, @@ -1523,6 +1504,7 @@ Methods: - client.calls.actions.send_sip_info(call_control_id, \*\*params) -> ActionSendSipInfoResponse - client.calls.actions.speak(call_control_id, \*\*params) -> ActionSpeakResponse - client.calls.actions.start_ai_assistant(call_control_id, \*\*params) -> ActionStartAIAssistantResponse +- client.calls.actions.start_conversation_relay(call_control_id, \*\*params) -> ActionStartConversationRelayResponse - client.calls.actions.start_forking(call_control_id, \*\*params) -> ActionStartForkingResponse - client.calls.actions.start_noise_suppression(call_control_id, \*\*params) -> ActionStartNoiseSuppressionResponse - client.calls.actions.start_playback(call_control_id, \*\*params) -> ActionStartPlaybackResponse @@ -1531,6 +1513,7 @@ Methods: - client.calls.actions.start_streaming(call_control_id, \*\*params) -> ActionStartStreamingResponse - client.calls.actions.start_transcription(call_control_id, \*\*params) -> ActionStartTranscriptionResponse - client.calls.actions.stop_ai_assistant(call_control_id, \*\*params) -> ActionStopAIAssistantResponse +- client.calls.actions.stop_conversation_relay(call_control_id, \*\*params) -> ActionStopConversationRelayResponse - client.calls.actions.stop_forking(call_control_id, \*\*params) -> ActionStopForkingResponse - client.calls.actions.stop_gather(call_control_id, \*\*params) -> ActionStopGatherResponse - client.calls.actions.stop_noise_suppression(call_control_id, \*\*params) -> ActionStopNoiseSuppressionResponse @@ -3706,9 +3689,9 @@ Types: from telnyx.types import ( NetworkInterface, NetworkInterfaceRegion, - PublicInternetGatewayRead, PublicInternetGatewayCreateResponse, PublicInternetGatewayRetrieveResponse, + PublicInternetGatewayListResponse, PublicInternetGatewayDeleteResponse, ) ``` @@ -3717,7 +3700,7 @@ Methods: - client.public_internet_gateways.create(\*\*params) -> PublicInternetGatewayCreateResponse - client.public_internet_gateways.retrieve(id) -> PublicInternetGatewayRetrieveResponse -- client.public_internet_gateways.list(\*\*params) -> SyncDefaultFlatPagination[PublicInternetGatewayRead] +- client.public_internet_gateways.list(\*\*params) -> SyncDefaultFlatPagination[PublicInternetGatewayListResponse] - client.public_internet_gateways.delete(id) -> PublicInternetGatewayDeleteResponse # Queues @@ -4802,10 +4785,10 @@ Types: ```python from telnyx.types import ( - VirtualCrossConnectCombined, VirtualCrossConnectCreateResponse, VirtualCrossConnectRetrieveResponse, VirtualCrossConnectUpdateResponse, + VirtualCrossConnectListResponse, VirtualCrossConnectDeleteResponse, ) ``` @@ -4815,7 +4798,7 @@ Methods: - client.virtual_cross_connects.create(\*\*params) -> VirtualCrossConnectCreateResponse - client.virtual_cross_connects.retrieve(id) -> VirtualCrossConnectRetrieveResponse - client.virtual_cross_connects.update(id, \*\*params) -> VirtualCrossConnectUpdateResponse -- client.virtual_cross_connects.list(\*\*params) -> SyncDefaultFlatPagination[VirtualCrossConnectCombined] +- client.virtual_cross_connects.list(\*\*params) -> SyncDefaultFlatPagination[VirtualCrossConnectListResponse] - client.virtual_cross_connects.delete(id) -> VirtualCrossConnectDeleteResponse # VirtualCrossConnectsCoverage @@ -4849,9 +4832,9 @@ Types: ```python from telnyx.types import ( - WireguardInterfaceRead, WireguardInterfaceCreateResponse, WireguardInterfaceRetrieveResponse, + WireguardInterfaceListResponse, WireguardInterfaceDeleteResponse, ) ``` @@ -4860,7 +4843,7 @@ Methods: - client.wireguard_interfaces.create(\*\*params) -> WireguardInterfaceCreateResponse - client.wireguard_interfaces.retrieve(id) -> WireguardInterfaceRetrieveResponse -- client.wireguard_interfaces.list(\*\*params) -> SyncDefaultFlatPagination[WireguardInterfaceRead] +- client.wireguard_interfaces.list(\*\*params) -> SyncDefaultFlatPagination[WireguardInterfaceListResponse] - client.wireguard_interfaces.delete(id) -> WireguardInterfaceDeleteResponse # WireguardPeers @@ -5672,14 +5655,10 @@ Types: ```python from telnyx.types import ( - UacConnection, - UacExternalSettings, - UacInbound, - UacInternalSettings, - UacOutbound, UacConnectionCreateResponse, UacConnectionRetrieveResponse, UacConnectionUpdateResponse, + UacConnectionListResponse, UacConnectionDeleteResponse, ) ``` @@ -5689,7 +5668,7 @@ Methods: - client.uac_connections.create(\*\*params) -> UacConnectionCreateResponse - client.uac_connections.retrieve(id) -> UacConnectionRetrieveResponse - client.uac_connections.update(id, \*\*params) -> UacConnectionUpdateResponse -- client.uac_connections.list(\*\*params) -> SyncDefaultFlatPagination[UacConnection] +- client.uac_connections.list(\*\*params) -> SyncDefaultFlatPagination[UacConnectionListResponse] - client.uac_connections.delete(id) -> UacConnectionDeleteResponse ## Actions diff --git a/pyproject.toml b/pyproject.toml index dda9ff1c..982342ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "telnyx" -version = "4.131.0" +version = "4.132.0" description = "The official Python library for the telnyx API" dynamic = ["readme"] license = "MIT" diff --git a/src/telnyx/_version.py b/src/telnyx/_version.py index 4f040695..b4b335e6 100644 --- a/src/telnyx/_version.py +++ b/src/telnyx/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "telnyx" -__version__ = "4.131.0" # x-release-please-version +__version__ = "4.132.0" # x-release-please-version diff --git a/src/telnyx/resources/ai/assistants/assistants.py b/src/telnyx/resources/ai/assistants/assistants.py index e663c115..9fdd9a15 100644 --- a/src/telnyx/resources/ai/assistants/assistants.py +++ b/src/telnyx/resources/ai/assistants/assistants.py @@ -89,12 +89,9 @@ from ....types.ai.telephony_settings_param import TelephonySettingsParam from ....types.ai.assistant_delete_response import AssistantDeleteResponse from ....types.ai.fallback_config_req_param import FallbackConfigReqParam -from ....types.ai.assistant_mcp_server_param import AssistantMcpServerParam -from ....types.ai.assistant_integration_param import AssistantIntegrationParam from ....types.ai.assistant_send_sms_response import AssistantSendSMSResponse from ....types.ai.transcription_settings_param import TranscriptionSettingsParam from ....types.ai.post_conversation_settings_req_param import PostConversationSettingsReqParam -from ....types.ai.inference_embedding_interruption_settings_param import InferenceEmbeddingInterruptionSettingsParam __all__ = ["AssistantsResource", "AsyncAssistantsResource"] @@ -165,10 +162,10 @@ def create( fallback_config: FallbackConfigReqParam | Omit = omit, greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[assistant_create_params.Integration] | Omit = omit, + interruption_settings: assistant_create_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[assistant_create_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, observability_settings: ObservabilityReqParam | Omit = omit, @@ -376,10 +373,10 @@ def update( greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, instructions: str | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[assistant_update_params.Integration] | Omit = omit, + interruption_settings: assistant_update_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[assistant_update_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, name: str | Omit = omit, @@ -890,10 +887,10 @@ async def create( fallback_config: FallbackConfigReqParam | Omit = omit, greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[assistant_create_params.Integration] | Omit = omit, + interruption_settings: assistant_create_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[assistant_create_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, observability_settings: ObservabilityReqParam | Omit = omit, @@ -1101,10 +1098,10 @@ async def update( greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, instructions: str | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[assistant_update_params.Integration] | Omit = omit, + interruption_settings: assistant_update_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[assistant_update_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, name: str | Omit = omit, diff --git a/src/telnyx/resources/ai/assistants/canary_deploys.py b/src/telnyx/resources/ai/assistants/canary_deploys.py index baf62939..09412a23 100644 --- a/src/telnyx/resources/ai/assistants/canary_deploys.py +++ b/src/telnyx/resources/ai/assistants/canary_deploys.py @@ -18,7 +18,6 @@ ) from ...._base_client import make_request_options from ....types.ai.assistants import canary_deploy_create_params, canary_deploy_update_params -from ....types.ai.assistants.rule_input_param import RuleInputParam from ....types.ai.assistants.canary_deploy_response import CanaryDeployResponse __all__ = ["CanaryDeploysResource", "AsyncCanaryDeploysResource"] @@ -50,7 +49,7 @@ def create( self, assistant_id: str, *, - rules: Iterable[RuleInputParam] | Omit = omit, + rules: Iterable[canary_deploy_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -124,7 +123,7 @@ def update( self, assistant_id: str, *, - rules: Iterable[RuleInputParam] | Omit = omit, + rules: Iterable[canary_deploy_update_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -222,7 +221,7 @@ async def create( self, assistant_id: str, *, - rules: Iterable[RuleInputParam] | Omit = omit, + rules: Iterable[canary_deploy_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -296,7 +295,7 @@ async def update( self, assistant_id: str, *, - rules: Iterable[RuleInputParam] | Omit = omit, + rules: Iterable[canary_deploy_update_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/telnyx/resources/ai/assistants/versions.py b/src/telnyx/resources/ai/assistants/versions.py index 821334b8..943cb317 100644 --- a/src/telnyx/resources/ai/assistants/versions.py +++ b/src/telnyx/resources/ai/assistants/versions.py @@ -31,11 +31,8 @@ from ....types.ai.messaging_settings_param import MessagingSettingsParam from ....types.ai.telephony_settings_param import TelephonySettingsParam from ....types.ai.fallback_config_req_param import FallbackConfigReqParam -from ....types.ai.assistant_mcp_server_param import AssistantMcpServerParam -from ....types.ai.assistant_integration_param import AssistantIntegrationParam from ....types.ai.transcription_settings_param import TranscriptionSettingsParam from ....types.ai.post_conversation_settings_req_param import PostConversationSettingsReqParam -from ....types.ai.inference_embedding_interruption_settings_param import InferenceEmbeddingInterruptionSettingsParam __all__ = ["VersionsResource", "AsyncVersionsResource"] @@ -122,10 +119,10 @@ def update( greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, instructions: str | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[version_update_params.Integration] | Omit = omit, + interruption_settings: version_update_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[version_update_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, name: str | Omit = omit, @@ -483,10 +480,10 @@ async def update( greeting: str | Omit = omit, insight_settings: InsightSettingsParam | Omit = omit, instructions: str | Omit = omit, - integrations: Iterable[AssistantIntegrationParam] | Omit = omit, - interruption_settings: InferenceEmbeddingInterruptionSettingsParam | Omit = omit, + integrations: Iterable[version_update_params.Integration] | Omit = omit, + interruption_settings: version_update_params.InterruptionSettings | Omit = omit, llm_api_key_ref: str | Omit = omit, - mcp_servers: Iterable[AssistantMcpServerParam] | Omit = omit, + mcp_servers: Iterable[version_update_params.McpServer] | Omit = omit, messaging_settings: MessagingSettingsParam | Omit = omit, model: str | Omit = omit, name: str | Omit = omit, diff --git a/src/telnyx/resources/calls/actions.py b/src/telnyx/resources/calls/actions.py index d76f3187..ecd8c67c 100644 --- a/src/telnyx/resources/calls/actions.py +++ b/src/telnyx/resources/calls/actions.py @@ -63,6 +63,8 @@ action_stop_noise_suppression_params, action_switch_supervisor_role_params, action_start_noise_suppression_params, + action_stop_conversation_relay_params, + action_start_conversation_relay_params, action_add_ai_assistant_messages_params, ) from ..._base_client import make_request_options @@ -119,6 +121,8 @@ from ...types.calls.action_stop_noise_suppression_response import ActionStopNoiseSuppressionResponse from ...types.calls.action_switch_supervisor_role_response import ActionSwitchSupervisorRoleResponse from ...types.calls.action_start_noise_suppression_response import ActionStartNoiseSuppressionResponse +from ...types.calls.action_stop_conversation_relay_response import ActionStopConversationRelayResponse +from ...types.calls.action_start_conversation_relay_response import ActionStartConversationRelayResponse from ...types.calls.action_add_ai_assistant_messages_response import ActionAddAIAssistantMessagesResponse __all__ = ["ActionsResource", "AsyncActionsResource"] @@ -2059,6 +2063,156 @@ def start_ai_assistant( cast_to=ActionStartAIAssistantResponse, ) + def start_conversation_relay( + self, + call_control_id: str, + *, + conversation_relay_url: str, + assistant: action_start_conversation_relay_params.Assistant | Omit = omit, + client_state: str | Omit = omit, + command_id: str | Omit = omit, + conversation_relay_dtmf_detection: bool | Omit = omit, + greeting: str | Omit = omit, + interruption_settings: action_start_conversation_relay_params.InterruptionSettings | Omit = omit, + language: str | Omit = omit, + languages: Iterable[action_start_conversation_relay_params.Language] | Omit = omit, + participants: Iterable[action_start_conversation_relay_params.Participant] | Omit = omit, + send_message_history_updates: bool | Omit = omit, + transcription: action_start_conversation_relay_params.Transcription | Omit = omit, + transcription_language: str | Omit = omit, + tts_language: str | Omit = omit, + user_response_timeout_ms: int | Omit = omit, + voice: str | Omit = omit, + voice_settings: action_start_conversation_relay_params.VoiceSettings | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ActionStartConversationRelayResponse: + """Start a Conversation Relay session on an active call. + + Conversation Relay + connects the call audio to your WebSocket so your application can exchange + realtime messages with the caller while Telnyx handles speech recognition and + text-to-speech. Only one AI Assistant or Conversation Relay session can be + active on a call at a time. + + **Expected Webhooks:** + + - `call.conversation.ended` - Sent when the Conversation Relay session ends. If + the customer WebSocket disconnects, the webhook payload `reason` is + `customer_disconnect`. + + Args: + conversation_relay_url: WebSocket URL for your Conversation Relay server. Must start with `ws://` or + `wss://`. + + assistant: Custom parameters for the Conversation Relay session. Pass key-value data as + `assistant.dynamic_variables` to make it available to the relay session. + + client_state: Use this field to add state to subsequent webhooks. It must be a valid Base-64 + encoded string. + + command_id: Use this field to avoid duplicate commands. Telnyx will ignore any command with + the same `command_id` for the same `call_control_id`. + + conversation_relay_dtmf_detection: Enable DTMF detection for the relay session. + + greeting: Text played when the relay session starts. + + interruption_settings: Settings for handling caller interruptions during Conversation Relay speech. + + language: Default language for the relay session. This value is used for both + text-to-speech and speech recognition unless `tts_language` or + `transcription_language` are provided. + + languages: Language-specific TTS and transcription settings. Use this when the relay + session needs per-language provider, voice, or speech model configuration. + + participants: Participants to add to the conversation. + + send_message_history_updates: When true, sends message history update webhooks. + + transcription: Speech-to-text settings for Conversation Relay. + + transcription_language: Language to use for speech recognition. Overrides `language` for transcription + when provided. + + tts_language: Language to use for text-to-speech. Overrides `language` for TTS when provided. + + user_response_timeout_ms: Time in milliseconds to wait for caller input before timing out. + + voice: The voice to be used by the voice assistant. Currently we support ElevenLabs, + Telnyx and AWS voices. + + **Supported Providers:** + + - **AWS:** Use `AWS.Polly.` (e.g., `AWS.Polly.Joanna`). For neural + voices, which provide more realistic, human-like speech, append `-Neural` to + the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the + [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html) + for compatibility. + - **Azure:** Use `Azure.. (e.g. Azure.en-CA-ClaraNeural, + Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural, + Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to + [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).) + - **ElevenLabs:** Use `ElevenLabs..` (e.g., + `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use + ElevenLabs, you must provide your ElevenLabs API key as an integration secret + under `"voice_settings": {"api_key_ref": ""}`. See + [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret) + for details. Check + [available voices](https://elevenlabs.io/docs/api-reference/get-voices). + - **Telnyx:** Use `Telnyx..` + - **Inworld:** Use `Inworld..` (e.g., `Inworld.Mini.Loretta`, + `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`. + - **xAI:** Use `xAI.` (e.g., `xAI.eve`). Available voices: `eve`, + `ara`, `rex`, `sal`, `leo`. + + voice_settings: The settings associated with the voice selected + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not call_control_id: + raise ValueError(f"Expected a non-empty value for `call_control_id` but received {call_control_id!r}") + return self._post( + path_template("/calls/{call_control_id}/actions/conversation_relay_start", call_control_id=call_control_id), + body=maybe_transform( + { + "conversation_relay_url": conversation_relay_url, + "assistant": assistant, + "client_state": client_state, + "command_id": command_id, + "conversation_relay_dtmf_detection": conversation_relay_dtmf_detection, + "greeting": greeting, + "interruption_settings": interruption_settings, + "language": language, + "languages": languages, + "participants": participants, + "send_message_history_updates": send_message_history_updates, + "transcription": transcription, + "transcription_language": transcription_language, + "tts_language": tts_language, + "user_response_timeout_ms": user_response_timeout_ms, + "voice": voice, + "voice_settings": voice_settings, + }, + action_start_conversation_relay_params.ActionStartConversationRelayParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ActionStartConversationRelayResponse, + ) + def start_forking( self, call_control_id: str, @@ -2979,6 +3133,54 @@ def stop_ai_assistant( cast_to=ActionStopAIAssistantResponse, ) + def stop_conversation_relay( + self, + call_control_id: str, + *, + client_state: str | Omit = omit, + command_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ActionStopConversationRelayResponse: + """ + Stop the active Conversation Relay session on a call. + + Args: + client_state: Use this field to add state to subsequent webhooks. It must be a valid Base-64 + encoded string. + + command_id: Use this field to avoid duplicate commands. Telnyx will ignore any command with + the same `command_id` for the same `call_control_id`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not call_control_id: + raise ValueError(f"Expected a non-empty value for `call_control_id` but received {call_control_id!r}") + return self._post( + path_template("/calls/{call_control_id}/actions/conversation_relay_stop", call_control_id=call_control_id), + body=maybe_transform( + { + "client_state": client_state, + "command_id": command_id, + }, + action_stop_conversation_relay_params.ActionStopConversationRelayParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ActionStopConversationRelayResponse, + ) + def stop_forking( self, call_control_id: str, @@ -5701,6 +5903,156 @@ async def start_ai_assistant( cast_to=ActionStartAIAssistantResponse, ) + async def start_conversation_relay( + self, + call_control_id: str, + *, + conversation_relay_url: str, + assistant: action_start_conversation_relay_params.Assistant | Omit = omit, + client_state: str | Omit = omit, + command_id: str | Omit = omit, + conversation_relay_dtmf_detection: bool | Omit = omit, + greeting: str | Omit = omit, + interruption_settings: action_start_conversation_relay_params.InterruptionSettings | Omit = omit, + language: str | Omit = omit, + languages: Iterable[action_start_conversation_relay_params.Language] | Omit = omit, + participants: Iterable[action_start_conversation_relay_params.Participant] | Omit = omit, + send_message_history_updates: bool | Omit = omit, + transcription: action_start_conversation_relay_params.Transcription | Omit = omit, + transcription_language: str | Omit = omit, + tts_language: str | Omit = omit, + user_response_timeout_ms: int | Omit = omit, + voice: str | Omit = omit, + voice_settings: action_start_conversation_relay_params.VoiceSettings | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ActionStartConversationRelayResponse: + """Start a Conversation Relay session on an active call. + + Conversation Relay + connects the call audio to your WebSocket so your application can exchange + realtime messages with the caller while Telnyx handles speech recognition and + text-to-speech. Only one AI Assistant or Conversation Relay session can be + active on a call at a time. + + **Expected Webhooks:** + + - `call.conversation.ended` - Sent when the Conversation Relay session ends. If + the customer WebSocket disconnects, the webhook payload `reason` is + `customer_disconnect`. + + Args: + conversation_relay_url: WebSocket URL for your Conversation Relay server. Must start with `ws://` or + `wss://`. + + assistant: Custom parameters for the Conversation Relay session. Pass key-value data as + `assistant.dynamic_variables` to make it available to the relay session. + + client_state: Use this field to add state to subsequent webhooks. It must be a valid Base-64 + encoded string. + + command_id: Use this field to avoid duplicate commands. Telnyx will ignore any command with + the same `command_id` for the same `call_control_id`. + + conversation_relay_dtmf_detection: Enable DTMF detection for the relay session. + + greeting: Text played when the relay session starts. + + interruption_settings: Settings for handling caller interruptions during Conversation Relay speech. + + language: Default language for the relay session. This value is used for both + text-to-speech and speech recognition unless `tts_language` or + `transcription_language` are provided. + + languages: Language-specific TTS and transcription settings. Use this when the relay + session needs per-language provider, voice, or speech model configuration. + + participants: Participants to add to the conversation. + + send_message_history_updates: When true, sends message history update webhooks. + + transcription: Speech-to-text settings for Conversation Relay. + + transcription_language: Language to use for speech recognition. Overrides `language` for transcription + when provided. + + tts_language: Language to use for text-to-speech. Overrides `language` for TTS when provided. + + user_response_timeout_ms: Time in milliseconds to wait for caller input before timing out. + + voice: The voice to be used by the voice assistant. Currently we support ElevenLabs, + Telnyx and AWS voices. + + **Supported Providers:** + + - **AWS:** Use `AWS.Polly.` (e.g., `AWS.Polly.Joanna`). For neural + voices, which provide more realistic, human-like speech, append `-Neural` to + the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the + [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html) + for compatibility. + - **Azure:** Use `Azure.. (e.g. Azure.en-CA-ClaraNeural, + Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural, + Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to + [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).) + - **ElevenLabs:** Use `ElevenLabs..` (e.g., + `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use + ElevenLabs, you must provide your ElevenLabs API key as an integration secret + under `"voice_settings": {"api_key_ref": ""}`. See + [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret) + for details. Check + [available voices](https://elevenlabs.io/docs/api-reference/get-voices). + - **Telnyx:** Use `Telnyx..` + - **Inworld:** Use `Inworld..` (e.g., `Inworld.Mini.Loretta`, + `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`. + - **xAI:** Use `xAI.` (e.g., `xAI.eve`). Available voices: `eve`, + `ara`, `rex`, `sal`, `leo`. + + voice_settings: The settings associated with the voice selected + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not call_control_id: + raise ValueError(f"Expected a non-empty value for `call_control_id` but received {call_control_id!r}") + return await self._post( + path_template("/calls/{call_control_id}/actions/conversation_relay_start", call_control_id=call_control_id), + body=await async_maybe_transform( + { + "conversation_relay_url": conversation_relay_url, + "assistant": assistant, + "client_state": client_state, + "command_id": command_id, + "conversation_relay_dtmf_detection": conversation_relay_dtmf_detection, + "greeting": greeting, + "interruption_settings": interruption_settings, + "language": language, + "languages": languages, + "participants": participants, + "send_message_history_updates": send_message_history_updates, + "transcription": transcription, + "transcription_language": transcription_language, + "tts_language": tts_language, + "user_response_timeout_ms": user_response_timeout_ms, + "voice": voice, + "voice_settings": voice_settings, + }, + action_start_conversation_relay_params.ActionStartConversationRelayParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ActionStartConversationRelayResponse, + ) + async def start_forking( self, call_control_id: str, @@ -6621,6 +6973,54 @@ async def stop_ai_assistant( cast_to=ActionStopAIAssistantResponse, ) + async def stop_conversation_relay( + self, + call_control_id: str, + *, + client_state: str | Omit = omit, + command_id: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ActionStopConversationRelayResponse: + """ + Stop the active Conversation Relay session on a call. + + Args: + client_state: Use this field to add state to subsequent webhooks. It must be a valid Base-64 + encoded string. + + command_id: Use this field to avoid duplicate commands. Telnyx will ignore any command with + the same `command_id` for the same `call_control_id`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not call_control_id: + raise ValueError(f"Expected a non-empty value for `call_control_id` but received {call_control_id!r}") + return await self._post( + path_template("/calls/{call_control_id}/actions/conversation_relay_stop", call_control_id=call_control_id), + body=await async_maybe_transform( + { + "client_state": client_state, + "command_id": command_id, + }, + action_stop_conversation_relay_params.ActionStopConversationRelayParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ActionStopConversationRelayResponse, + ) + async def stop_forking( self, call_control_id: str, @@ -7471,6 +7871,9 @@ def __init__(self, actions: ActionsResource) -> None: self.start_ai_assistant = to_raw_response_wrapper( actions.start_ai_assistant, ) + self.start_conversation_relay = to_raw_response_wrapper( + actions.start_conversation_relay, + ) self.start_forking = to_raw_response_wrapper( actions.start_forking, ) @@ -7495,6 +7898,9 @@ def __init__(self, actions: ActionsResource) -> None: self.stop_ai_assistant = to_raw_response_wrapper( actions.stop_ai_assistant, ) + self.stop_conversation_relay = to_raw_response_wrapper( + actions.stop_conversation_relay, + ) self.stop_forking = to_raw_response_wrapper( actions.stop_forking, ) @@ -7591,6 +7997,9 @@ def __init__(self, actions: AsyncActionsResource) -> None: self.start_ai_assistant = async_to_raw_response_wrapper( actions.start_ai_assistant, ) + self.start_conversation_relay = async_to_raw_response_wrapper( + actions.start_conversation_relay, + ) self.start_forking = async_to_raw_response_wrapper( actions.start_forking, ) @@ -7615,6 +8024,9 @@ def __init__(self, actions: AsyncActionsResource) -> None: self.stop_ai_assistant = async_to_raw_response_wrapper( actions.stop_ai_assistant, ) + self.stop_conversation_relay = async_to_raw_response_wrapper( + actions.stop_conversation_relay, + ) self.stop_forking = async_to_raw_response_wrapper( actions.stop_forking, ) @@ -7711,6 +8123,9 @@ def __init__(self, actions: ActionsResource) -> None: self.start_ai_assistant = to_streamed_response_wrapper( actions.start_ai_assistant, ) + self.start_conversation_relay = to_streamed_response_wrapper( + actions.start_conversation_relay, + ) self.start_forking = to_streamed_response_wrapper( actions.start_forking, ) @@ -7735,6 +8150,9 @@ def __init__(self, actions: ActionsResource) -> None: self.stop_ai_assistant = to_streamed_response_wrapper( actions.stop_ai_assistant, ) + self.stop_conversation_relay = to_streamed_response_wrapper( + actions.stop_conversation_relay, + ) self.stop_forking = to_streamed_response_wrapper( actions.stop_forking, ) @@ -7831,6 +8249,9 @@ def __init__(self, actions: AsyncActionsResource) -> None: self.start_ai_assistant = async_to_streamed_response_wrapper( actions.start_ai_assistant, ) + self.start_conversation_relay = async_to_streamed_response_wrapper( + actions.start_conversation_relay, + ) self.start_forking = async_to_streamed_response_wrapper( actions.start_forking, ) @@ -7855,6 +8276,9 @@ def __init__(self, actions: AsyncActionsResource) -> None: self.stop_ai_assistant = async_to_streamed_response_wrapper( actions.stop_ai_assistant, ) + self.stop_conversation_relay = async_to_streamed_response_wrapper( + actions.stop_conversation_relay, + ) self.stop_forking = async_to_streamed_response_wrapper( actions.stop_forking, ) diff --git a/src/telnyx/resources/public_internet_gateways.py b/src/telnyx/resources/public_internet_gateways.py index 7e7919b1..8e8f9c52 100644 --- a/src/telnyx/resources/public_internet_gateways.py +++ b/src/telnyx/resources/public_internet_gateways.py @@ -17,7 +17,7 @@ ) from ..pagination import SyncDefaultFlatPagination, AsyncDefaultFlatPagination from .._base_client import AsyncPaginator, make_request_options -from ..types.public_internet_gateway_read import PublicInternetGatewayRead +from ..types.public_internet_gateway_list_response import PublicInternetGatewayListResponse from ..types.public_internet_gateway_create_response import PublicInternetGatewayCreateResponse from ..types.public_internet_gateway_delete_response import PublicInternetGatewayDeleteResponse from ..types.public_internet_gateway_retrieve_response import PublicInternetGatewayRetrieveResponse @@ -139,7 +139,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncDefaultFlatPagination[PublicInternetGatewayRead]: + ) -> SyncDefaultFlatPagination[PublicInternetGatewayListResponse]: """ List all Public Internet Gateways. @@ -156,7 +156,7 @@ def list( """ return self._get_api_list( "/public_internet_gateways", - page=SyncDefaultFlatPagination[PublicInternetGatewayRead], + page=SyncDefaultFlatPagination[PublicInternetGatewayListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -171,7 +171,7 @@ def list( public_internet_gateway_list_params.PublicInternetGatewayListParams, ), ), - model=PublicInternetGatewayRead, + model=PublicInternetGatewayListResponse, ) def delete( @@ -322,7 +322,9 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[PublicInternetGatewayRead, AsyncDefaultFlatPagination[PublicInternetGatewayRead]]: + ) -> AsyncPaginator[ + PublicInternetGatewayListResponse, AsyncDefaultFlatPagination[PublicInternetGatewayListResponse] + ]: """ List all Public Internet Gateways. @@ -339,7 +341,7 @@ def list( """ return self._get_api_list( "/public_internet_gateways", - page=AsyncDefaultFlatPagination[PublicInternetGatewayRead], + page=AsyncDefaultFlatPagination[PublicInternetGatewayListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -354,7 +356,7 @@ def list( public_internet_gateway_list_params.PublicInternetGatewayListParams, ), ), - model=PublicInternetGatewayRead, + model=PublicInternetGatewayListResponse, ) async def delete( diff --git a/src/telnyx/resources/uac_connections/uac_connections.py b/src/telnyx/resources/uac_connections/uac_connections.py index 87dcdaab..53a7d738 100644 --- a/src/telnyx/resources/uac_connections/uac_connections.py +++ b/src/telnyx/resources/uac_connections/uac_connections.py @@ -36,12 +36,9 @@ from ...pagination import SyncDefaultFlatPagination, AsyncDefaultFlatPagination from ..._base_client import AsyncPaginator, make_request_options from ...types.dtmf_type import DtmfType -from ...types.uac_connection import UacConnection from ...types.encrypted_media import EncryptedMedia -from ...types.uac_outbound_param import UacOutboundParam from ...types.anchorsite_override import AnchorsiteOverride -from ...types.uac_external_settings_param import UacExternalSettingsParam -from ...types.uac_internal_settings_param import UacInternalSettingsParam +from ...types.uac_connection_list_response import UacConnectionListResponse from ...types.connection_rtcp_settings_param import ConnectionRtcpSettingsParam from ...types.uac_connection_create_response import UacConnectionCreateResponse from ...types.uac_connection_delete_response import UacConnectionDeleteResponse @@ -92,15 +89,15 @@ def create( dtmf_type: DtmfType | Omit = omit, encode_contact_header_enabled: bool | Omit = omit, encrypted_media: Optional[EncryptedMedia] | Omit = omit, - external_uac_settings: UacExternalSettingsParam | Omit = omit, + external_uac_settings: uac_connection_create_params.ExternalUacSettings | Omit = omit, inbound: uac_connection_create_params.Inbound | Omit = omit, - internal_uac_settings: UacInternalSettingsParam | Omit = omit, + internal_uac_settings: uac_connection_create_params.InternalUacSettings | Omit = omit, ios_push_credential_id: Optional[str] | Omit = omit, jitter_buffer: ConnectionJitterBuffer | Omit = omit, noise_suppression: Literal["inbound", "outbound", "both", "disabled"] | Omit = omit, noise_suppression_details: ConnectionNoiseSuppressionDetails | Omit = omit, onnet_t38_passthrough_enabled: bool | Omit = omit, - outbound: UacOutboundParam | Omit = omit, + outbound: uac_connection_create_params.Outbound | Omit = omit, password: str | Omit = omit, rtcp_settings: ConnectionRtcpSettingsParam | Omit = omit, sip_uri_calling_preference: Literal["disabled", "unrestricted", "internal"] | Omit = omit, @@ -301,15 +298,15 @@ def update( dtmf_type: DtmfType | Omit = omit, encode_contact_header_enabled: bool | Omit = omit, encrypted_media: Optional[EncryptedMedia] | Omit = omit, - external_uac_settings: UacExternalSettingsParam | Omit = omit, + external_uac_settings: uac_connection_update_params.ExternalUacSettings | Omit = omit, inbound: uac_connection_update_params.Inbound | Omit = omit, - internal_uac_settings: UacInternalSettingsParam | Omit = omit, + internal_uac_settings: uac_connection_update_params.InternalUacSettings | Omit = omit, ios_push_credential_id: Optional[str] | Omit = omit, jitter_buffer: ConnectionJitterBuffer | Omit = omit, noise_suppression: Literal["inbound", "outbound", "both", "disabled"] | Omit = omit, noise_suppression_details: ConnectionNoiseSuppressionDetails | Omit = omit, onnet_t38_passthrough_enabled: bool | Omit = omit, - outbound: UacOutboundParam | Omit = omit, + outbound: uac_connection_update_params.Outbound | Omit = omit, password: str | Omit = omit, rtcp_settings: ConnectionRtcpSettingsParam | Omit = omit, sip_uri_calling_preference: Literal["disabled", "unrestricted", "internal"] | Omit = omit, @@ -473,7 +470,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncDefaultFlatPagination[UacConnection]: + ) -> SyncDefaultFlatPagination[UacConnectionListResponse]: """Returns a list of your UAC connections. A UAC (User Agent Client) Connection @@ -512,7 +509,7 @@ def list( """ return self._get_api_list( "/uac_connections", - page=SyncDefaultFlatPagination[UacConnection], + page=SyncDefaultFlatPagination[UacConnectionListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -528,7 +525,7 @@ def list( uac_connection_list_params.UacConnectionListParams, ), ), - model=UacConnection, + model=UacConnectionListResponse, ) def delete( @@ -604,15 +601,15 @@ async def create( dtmf_type: DtmfType | Omit = omit, encode_contact_header_enabled: bool | Omit = omit, encrypted_media: Optional[EncryptedMedia] | Omit = omit, - external_uac_settings: UacExternalSettingsParam | Omit = omit, + external_uac_settings: uac_connection_create_params.ExternalUacSettings | Omit = omit, inbound: uac_connection_create_params.Inbound | Omit = omit, - internal_uac_settings: UacInternalSettingsParam | Omit = omit, + internal_uac_settings: uac_connection_create_params.InternalUacSettings | Omit = omit, ios_push_credential_id: Optional[str] | Omit = omit, jitter_buffer: ConnectionJitterBuffer | Omit = omit, noise_suppression: Literal["inbound", "outbound", "both", "disabled"] | Omit = omit, noise_suppression_details: ConnectionNoiseSuppressionDetails | Omit = omit, onnet_t38_passthrough_enabled: bool | Omit = omit, - outbound: UacOutboundParam | Omit = omit, + outbound: uac_connection_create_params.Outbound | Omit = omit, password: str | Omit = omit, rtcp_settings: ConnectionRtcpSettingsParam | Omit = omit, sip_uri_calling_preference: Literal["disabled", "unrestricted", "internal"] | Omit = omit, @@ -813,15 +810,15 @@ async def update( dtmf_type: DtmfType | Omit = omit, encode_contact_header_enabled: bool | Omit = omit, encrypted_media: Optional[EncryptedMedia] | Omit = omit, - external_uac_settings: UacExternalSettingsParam | Omit = omit, + external_uac_settings: uac_connection_update_params.ExternalUacSettings | Omit = omit, inbound: uac_connection_update_params.Inbound | Omit = omit, - internal_uac_settings: UacInternalSettingsParam | Omit = omit, + internal_uac_settings: uac_connection_update_params.InternalUacSettings | Omit = omit, ios_push_credential_id: Optional[str] | Omit = omit, jitter_buffer: ConnectionJitterBuffer | Omit = omit, noise_suppression: Literal["inbound", "outbound", "both", "disabled"] | Omit = omit, noise_suppression_details: ConnectionNoiseSuppressionDetails | Omit = omit, onnet_t38_passthrough_enabled: bool | Omit = omit, - outbound: UacOutboundParam | Omit = omit, + outbound: uac_connection_update_params.Outbound | Omit = omit, password: str | Omit = omit, rtcp_settings: ConnectionRtcpSettingsParam | Omit = omit, sip_uri_calling_preference: Literal["disabled", "unrestricted", "internal"] | Omit = omit, @@ -985,7 +982,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[UacConnection, AsyncDefaultFlatPagination[UacConnection]]: + ) -> AsyncPaginator[UacConnectionListResponse, AsyncDefaultFlatPagination[UacConnectionListResponse]]: """Returns a list of your UAC connections. A UAC (User Agent Client) Connection @@ -1024,7 +1021,7 @@ def list( """ return self._get_api_list( "/uac_connections", - page=AsyncDefaultFlatPagination[UacConnection], + page=AsyncDefaultFlatPagination[UacConnectionListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1040,7 +1037,7 @@ def list( uac_connection_list_params.UacConnectionListParams, ), ), - model=UacConnection, + model=UacConnectionListResponse, ) async def delete( diff --git a/src/telnyx/resources/virtual_cross_connects.py b/src/telnyx/resources/virtual_cross_connects.py index a7b37fbc..042383c0 100644 --- a/src/telnyx/resources/virtual_cross_connects.py +++ b/src/telnyx/resources/virtual_cross_connects.py @@ -23,7 +23,7 @@ ) from ..pagination import SyncDefaultFlatPagination, AsyncDefaultFlatPagination from .._base_client import AsyncPaginator, make_request_options -from ..types.virtual_cross_connect_combined import VirtualCrossConnectCombined +from ..types.virtual_cross_connect_list_response import VirtualCrossConnectListResponse from ..types.virtual_cross_connect_create_response import VirtualCrossConnectCreateResponse from ..types.virtual_cross_connect_delete_response import VirtualCrossConnectDeleteResponse from ..types.virtual_cross_connect_update_response import VirtualCrossConnectUpdateResponse @@ -294,7 +294,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncDefaultFlatPagination[VirtualCrossConnectCombined]: + ) -> SyncDefaultFlatPagination[VirtualCrossConnectListResponse]: """ List all Virtual Cross Connects. @@ -311,7 +311,7 @@ def list( """ return self._get_api_list( "/virtual_cross_connects", - page=SyncDefaultFlatPagination[VirtualCrossConnectCombined], + page=SyncDefaultFlatPagination[VirtualCrossConnectListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -326,7 +326,7 @@ def list( virtual_cross_connect_list_params.VirtualCrossConnectListParams, ), ), - model=VirtualCrossConnectCombined, + model=VirtualCrossConnectListResponse, ) def delete( @@ -625,7 +625,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[VirtualCrossConnectCombined, AsyncDefaultFlatPagination[VirtualCrossConnectCombined]]: + ) -> AsyncPaginator[VirtualCrossConnectListResponse, AsyncDefaultFlatPagination[VirtualCrossConnectListResponse]]: """ List all Virtual Cross Connects. @@ -642,7 +642,7 @@ def list( """ return self._get_api_list( "/virtual_cross_connects", - page=AsyncDefaultFlatPagination[VirtualCrossConnectCombined], + page=AsyncDefaultFlatPagination[VirtualCrossConnectListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -657,7 +657,7 @@ def list( virtual_cross_connect_list_params.VirtualCrossConnectListParams, ), ), - model=VirtualCrossConnectCombined, + model=VirtualCrossConnectListResponse, ) async def delete( diff --git a/src/telnyx/resources/wireguard_interfaces.py b/src/telnyx/resources/wireguard_interfaces.py index d2f6bad1..3266d472 100644 --- a/src/telnyx/resources/wireguard_interfaces.py +++ b/src/telnyx/resources/wireguard_interfaces.py @@ -17,7 +17,7 @@ ) from ..pagination import SyncDefaultFlatPagination, AsyncDefaultFlatPagination from .._base_client import AsyncPaginator, make_request_options -from ..types.wireguard_interface_read import WireguardInterfaceRead +from ..types.wireguard_interface_list_response import WireguardInterfaceListResponse from ..types.wireguard_interface_create_response import WireguardInterfaceCreateResponse from ..types.wireguard_interface_delete_response import WireguardInterfaceDeleteResponse from ..types.wireguard_interface_retrieve_response import WireguardInterfaceRetrieveResponse @@ -145,7 +145,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncDefaultFlatPagination[WireguardInterfaceRead]: + ) -> SyncDefaultFlatPagination[WireguardInterfaceListResponse]: """ List all WireGuard Interfaces. @@ -162,7 +162,7 @@ def list( """ return self._get_api_list( "/wireguard_interfaces", - page=SyncDefaultFlatPagination[WireguardInterfaceRead], + page=SyncDefaultFlatPagination[WireguardInterfaceListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -177,7 +177,7 @@ def list( wireguard_interface_list_params.WireguardInterfaceListParams, ), ), - model=WireguardInterfaceRead, + model=WireguardInterfaceListResponse, ) def delete( @@ -334,7 +334,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[WireguardInterfaceRead, AsyncDefaultFlatPagination[WireguardInterfaceRead]]: + ) -> AsyncPaginator[WireguardInterfaceListResponse, AsyncDefaultFlatPagination[WireguardInterfaceListResponse]]: """ List all WireGuard Interfaces. @@ -351,7 +351,7 @@ def list( """ return self._get_api_list( "/wireguard_interfaces", - page=AsyncDefaultFlatPagination[WireguardInterfaceRead], + page=AsyncDefaultFlatPagination[WireguardInterfaceListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -366,7 +366,7 @@ def list( wireguard_interface_list_params.WireguardInterfaceListParams, ), ), - model=WireguardInterfaceRead, + model=WireguardInterfaceListResponse, ) async def delete( diff --git a/src/telnyx/types/__init__.py b/src/telnyx/types/__init__.py index 953bb767..6923ec4d 100644 --- a/src/telnyx/types/__init__.py +++ b/src/telnyx/types/__init__.py @@ -25,7 +25,6 @@ CostInformation as CostInformation, NetappsLocation as NetappsLocation, RoomParticipant as RoomParticipant, - XaiVoiceSettings as XaiVoiceSettings, RegionInformation as RegionInformation, RimeVoiceSettings as RimeVoiceSettings, AzureVoiceSettings as AzureVoiceSettings, @@ -71,7 +70,6 @@ from .oauth_grant import OAuthGrant as OAuthGrant from .outbound_ip import OutboundIP as OutboundIP from .rcs_to_item import RcsToItem as RcsToItem -from .uac_inbound import UacInbound as UacInbound from .call_bridged import CallBridged as CallBridged from .inbound_fqdn import InboundFqdn as InboundFqdn from .month_detail import MonthDetail as MonthDetail @@ -81,7 +79,6 @@ from .service_plan import ServicePlan as ServicePlan from .stream_codec import StreamCodec as StreamCodec from .traffic_type import TrafficType as TrafficType -from .uac_outbound import UacOutbound as UacOutbound from .user_address import UserAddress as UserAddress from .verification import Verification as Verification from .video_region import VideoRegion as VideoRegion @@ -97,12 +94,10 @@ from .call_initiated import CallInitiated as CallInitiated from .ip_list_params import IPListParams as IPListParams from .media_resource import MediaResource as MediaResource -from .model_metadata import ModelMetadata as ModelMetadata from .rcs_suggestion import RcsSuggestion as RcsSuggestion from .settings_param import SettingsParam as SettingsParam from .sim_card_group import SimCardGroup as SimCardGroup from .sim_card_order import SimCardOrder as SimCardOrder -from .uac_connection import UacConnection as UacConnection from .verify_profile import VerifyProfile as VerifyProfile from .whatsapp_media import WhatsappMedia as WhatsappMedia from .wireless_error import WirelessError as WirelessError @@ -152,6 +147,7 @@ from .fax_create_params import FaxCreateParams as FaxCreateParams from .media_list_params import MediaListParams as MediaListParams from .messaging_profile import MessagingProfile as MessagingProfile +from .network_interface import NetworkInterface as NetworkInterface from .outbound_ip_param import OutboundIPParam as OutboundIPParam from .queue_list_params import QueueListParams as QueueListParams from .rcs_agent_message import RcsAgentMessage as RcsAgentMessage @@ -183,7 +179,6 @@ from .room_create_params import RoomCreateParams as RoomCreateParams from .room_update_params import RoomUpdateParams as RoomUpdateParams from .transport_protocol import TransportProtocol as TransportProtocol -from .uac_outbound_param import UacOutboundParam as UacOutboundParam from .video_region_param import VideoRegionParam as VideoRegionParam from .wireless_blocklist import WirelessBlocklist as WirelessBlocklist from .address_list_params import AddressListParams as AddressListParams @@ -272,8 +267,6 @@ from .recording_list_params import RecordingListParams as RecordingListParams from .reserved_phone_number import ReservedPhoneNumber as ReservedPhoneNumber from .s3_configuration_data import S3ConfigurationData as S3ConfigurationData -from .uac_external_settings import UacExternalSettings as UacExternalSettings -from .uac_internal_settings import UacInternalSettings as UacInternalSettings from .alphanumeric_sender_id import AlphanumericSenderID as AlphanumericSenderID from .call_event_list_params import CallEventListParams as CallEventListParams from .call_streaming_started import CallStreamingStarted as CallStreamingStarted @@ -380,7 +373,6 @@ from .user_address_list_params import UserAddressListParams as UserAddressListParams from .voice_design_list_params import VoiceDesignListParams as VoiceDesignListParams from .whatsapp_message_content import WhatsappMessageContent as WhatsappMessageContent -from .wireguard_interface_read import WireguardInterfaceRead as WireguardInterfaceRead from .address_retrieve_response import AddressRetrieveResponse as AddressRetrieveResponse from .ai_create_response_params import AICreateResponseParams as AICreateResponseParams from .audit_event_list_response import AuditEventListResponse as AuditEventListResponse @@ -480,8 +472,6 @@ from .reserved_phone_number_param import ReservedPhoneNumberParam as ReservedPhoneNumberParam from .s3_configuration_data_param import S3ConfigurationDataParam as S3ConfigurationDataParam from .transcription_webhook_event import TranscriptionWebhookEvent as TranscriptionWebhookEvent -from .uac_external_settings_param import UacExternalSettingsParam as UacExternalSettingsParam -from .uac_internal_settings_param import UacInternalSettingsParam as UacInternalSettingsParam from .unsafe_unwrap_webhook_event import UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent from .verified_number_list_params import VerifiedNumberListParams as VerifiedNumberListParams from .voice_clone_create_response import VoiceCloneCreateResponse as VoiceCloneCreateResponse @@ -513,7 +503,6 @@ from .porting_order_end_user_admin import PortingOrderEndUserAdmin as PortingOrderEndUserAdmin from .porting_order_end_user_param import PortingOrderEndUserParam as PortingOrderEndUserParam from .portout_update_status_params import PortoutUpdateStatusParams as PortoutUpdateStatusParams -from .public_internet_gateway_read import PublicInternetGatewayRead as PublicInternetGatewayRead from .requirement_type_list_params import RequirementTypeListParams as RequirementTypeListParams from .room_composition_list_params import RoomCompositionListParams as RoomCompositionListParams from .room_participant_list_params import RoomParticipantListParams as RoomParticipantListParams @@ -525,6 +514,7 @@ from .sim_card_order_create_params import SimCardOrderCreateParams as SimCardOrderCreateParams from .sub_number_order_list_params import SubNumberOrderListParams as SubNumberOrderListParams from .uac_connection_create_params import UacConnectionCreateParams as UacConnectionCreateParams +from .uac_connection_list_response import UacConnectionListResponse as UacConnectionListResponse from .uac_connection_update_params import UacConnectionUpdateParams as UacConnectionUpdateParams from .url_shortener_settings_param import URLShortenerSettingsParam as URLShortenerSettingsParam from .user_address_create_response import UserAddressCreateResponse as UserAddressCreateResponse @@ -623,7 +613,6 @@ from .uac_connection_update_response import UacConnectionUpdateResponse as UacConnectionUpdateResponse from .user_address_retrieve_response import UserAddressRetrieveResponse as UserAddressRetrieveResponse from .verification_retrieve_response import VerificationRetrieveResponse as VerificationRetrieveResponse -from .virtual_cross_connect_combined import VirtualCrossConnectCombined as VirtualCrossConnectCombined from .voice_design_retrieve_response import VoiceDesignRetrieveResponse as VoiceDesignRetrieveResponse from .webhook_delivery_list_response import WebhookDeliveryListResponse as WebhookDeliveryListResponse from .whatsapp_message_content_param import WhatsappMessageContentParam as WhatsappMessageContentParam @@ -754,6 +743,7 @@ from .usage_report_get_options_response import UsageReportGetOptionsResponse as UsageReportGetOptionsResponse from .virtual_cross_connect_list_params import VirtualCrossConnectListParams as VirtualCrossConnectListParams from .wireguard_interface_create_params import WireguardInterfaceCreateParams as WireguardInterfaceCreateParams +from .wireguard_interface_list_response import WireguardInterfaceListResponse as WireguardInterfaceListResponse from .alphanumeric_sender_id_list_params import AlphanumericSenderIDListParams as AlphanumericSenderIDListParams from .available_phone_number_list_params import AvailablePhoneNumberListParams as AvailablePhoneNumberListParams from .bulk_sim_card_action_list_response import BulkSimCardActionListResponse as BulkSimCardActionListResponse @@ -827,6 +817,7 @@ from .text_to_speech_list_voices_response import TextToSpeechListVoicesResponse as TextToSpeechListVoicesResponse from .update_regulatory_requirement_param import UpdateRegulatoryRequirementParam as UpdateRegulatoryRequirementParam from .virtual_cross_connect_create_params import VirtualCrossConnectCreateParams as VirtualCrossConnectCreateParams +from .virtual_cross_connect_list_response import VirtualCrossConnectListResponse as VirtualCrossConnectListResponse from .virtual_cross_connect_update_params import VirtualCrossConnectUpdateParams as VirtualCrossConnectUpdateParams from .voice_design_download_sample_params import VoiceDesignDownloadSampleParams as VoiceDesignDownloadSampleParams from .wireguard_interface_create_response import WireguardInterfaceCreateResponse as WireguardInterfaceCreateResponse @@ -942,6 +933,9 @@ from .public_internet_gateway_create_params import ( PublicInternetGatewayCreateParams as PublicInternetGatewayCreateParams, ) +from .public_internet_gateway_list_response import ( + PublicInternetGatewayListResponse as PublicInternetGatewayListResponse, +) from .sim_card_get_activation_code_response import SimCardGetActivationCodeResponse as SimCardGetActivationCodeResponse from .sim_card_order_preview_preview_params import SimCardOrderPreviewPreviewParams as SimCardOrderPreviewPreviewParams from .verification_trigger_flashcall_params import ( diff --git a/src/telnyx/types/ai/__init__.py b/src/telnyx/types/ai/__init__.py index 6f72480c..8e05d068 100644 --- a/src/telnyx/types/ai/__init__.py +++ b/src/telnyx/types/ai/__init__.py @@ -34,9 +34,7 @@ from .cluster_list_params import ClusterListParams as ClusterListParams from .inference_embedding import InferenceEmbedding as InferenceEmbedding from .mission_list_params import MissionListParams as MissionListParams -from .start_speaking_plan import StartSpeakingPlan as StartSpeakingPlan from .transfer_tool_param import TransferToolParam as TransferToolParam -from .assistant_mcp_server import AssistantMcpServer as AssistantMcpServer from .assistant_tool_param import AssistantToolParam as AssistantToolParam from .embedding_url_params import EmbeddingURLParams as EmbeddingURLParams from .retrieval_tool_param import RetrievalToolParam as RetrievalToolParam @@ -44,7 +42,6 @@ from .tool_update_response import ToolUpdateResponse as ToolUpdateResponse from .voice_settings_param import VoiceSettingsParam as VoiceSettingsParam from .assistant_chat_params import AssistantChatParams as AssistantChatParams -from .assistant_integration import AssistantIntegration as AssistantIntegration from .cluster_list_response import ClusterListResponse as ClusterListResponse from .embedding_list_params import EmbeddingListParams as EmbeddingListParams from .mission_create_params import MissionCreateParams as MissionCreateParams @@ -84,8 +81,6 @@ from .fallback_config_req_param import FallbackConfigReqParam as FallbackConfigReqParam from .integration_list_response import IntegrationListResponse as IntegrationListResponse from .mission_retrieve_response import MissionRetrieveResponse as MissionRetrieveResponse -from .start_speaking_plan_param import StartSpeakingPlanParam as StartSpeakingPlanParam -from .assistant_mcp_server_param import AssistantMcpServerParam as AssistantMcpServerParam from .cluster_fetch_graph_params import ClusterFetchGraphParams as ClusterFetchGraphParams from .conversation_create_params import ConversationCreateParams as ConversationCreateParams from .conversation_list_response import ConversationListResponse as ConversationListResponse @@ -94,7 +89,6 @@ from .mcp_server_update_response import McpServerUpdateResponse as McpServerUpdateResponse from .mission_list_events_params import MissionListEventsParams as MissionListEventsParams from .post_conversation_settings import PostConversationSettings as PostConversationSettings -from .assistant_integration_param import AssistantIntegrationParam as AssistantIntegrationParam from .assistant_send_sms_response import AssistantSendSMSResponse as AssistantSendSMSResponse from .embedding_retrieve_response import EmbeddingRetrieveResponse as EmbeddingRetrieveResponse from .openai_list_models_response import OpenAIListModelsResponse as OpenAIListModelsResponse @@ -109,7 +103,6 @@ from .openai_create_response_params import OpenAICreateResponseParams as OpenAICreateResponseParams from .transcription_settings_config import TranscriptionSettingsConfig as TranscriptionSettingsConfig from .conversation_retrieve_response import ConversationRetrieveResponse as ConversationRetrieveResponse -from .transcription_endpointing_plan import TranscriptionEndpointingPlan as TranscriptionEndpointingPlan from .chat_create_completion_response import ChatCreateCompletionResponse as ChatCreateCompletionResponse from .conversation_add_message_params import ConversationAddMessageParams as ConversationAddMessageParams from .mission_update_mission_response import MissionUpdateMissionResponse as MissionUpdateMissionResponse @@ -118,19 +111,12 @@ from .transcription_settings_config_param import TranscriptionSettingsConfigParam as TranscriptionSettingsConfigParam from .embedding_similarity_search_response import EmbeddingSimilaritySearchResponse as EmbeddingSimilaritySearchResponse from .post_conversation_settings_req_param import PostConversationSettingsReqParam as PostConversationSettingsReqParam -from .transcription_endpointing_plan_param import TranscriptionEndpointingPlanParam as TranscriptionEndpointingPlanParam from .inference_embedding_webhook_tool_params import ( InferenceEmbeddingWebhookToolParams as InferenceEmbeddingWebhookToolParams, ) -from .inference_embedding_interruption_settings import ( - InferenceEmbeddingInterruptionSettings as InferenceEmbeddingInterruptionSettings, -) from .inference_embedding_webhook_tool_params_param import ( InferenceEmbeddingWebhookToolParamsParam as InferenceEmbeddingWebhookToolParamsParam, ) -from .inference_embedding_interruption_settings_param import ( - InferenceEmbeddingInterruptionSettingsParam as InferenceEmbeddingInterruptionSettingsParam, -) from .conversation_retrieve_conversations_insights_response import ( ConversationRetrieveConversationsInsightsResponse as ConversationRetrieveConversationsInsightsResponse, ) diff --git a/src/telnyx/types/ai/assistant_create_params.py b/src/telnyx/types/ai/assistant_create_params.py index 57507ef9..36427e77 100644 --- a/src/telnyx/types/ai/assistant_create_params.py +++ b/src/telnyx/types/ai/assistant_create_params.py @@ -17,13 +17,17 @@ from .messaging_settings_param import MessagingSettingsParam from .telephony_settings_param import TelephonySettingsParam from .fallback_config_req_param import FallbackConfigReqParam -from .assistant_mcp_server_param import AssistantMcpServerParam -from .assistant_integration_param import AssistantIntegrationParam from .transcription_settings_param import TranscriptionSettingsParam from .post_conversation_settings_req_param import PostConversationSettingsReqParam -from .inference_embedding_interruption_settings_param import InferenceEmbeddingInterruptionSettingsParam -__all__ = ["AssistantCreateParams"] +__all__ = [ + "AssistantCreateParams", + "Integration", + "InterruptionSettings", + "InterruptionSettingsStartSpeakingPlan", + "InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan", + "McpServer", +] class AssistantCreateParams(TypedDict, total=False): @@ -79,7 +83,7 @@ class AssistantCreateParams(TypedDict, total=False): insight_settings: InsightSettingsParam - integrations: Iterable[AssistantIntegrationParam] + integrations: Iterable[Integration] """Connected integrations attached to the assistant. The catalog of available integrations is at `/ai/integrations`; the user's @@ -87,7 +91,7 @@ class AssistantCreateParams(TypedDict, total=False): references a catalog integration by `integration_id`. """ - interruption_settings: InferenceEmbeddingInterruptionSettingsParam + interruption_settings: InterruptionSettings """ Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking @@ -107,7 +111,7 @@ class AssistantCreateParams(TypedDict, total=False): are unlikely to work with this integration. """ - mcp_servers: Iterable[AssistantMcpServerParam] + mcp_servers: Iterable[McpServer] """MCP servers attached to the assistant. Create MCP servers with `/ai/mcp_servers`, then reference them by `id` here. @@ -166,3 +170,100 @@ class AssistantCreateParams(TypedDict, total=False): widget_settings: WidgetSettingsParam """Configuration settings for the assistant's web widget.""" + + +class Integration(TypedDict, total=False): + """Reference to a connected integration attached to an assistant. + + Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. + """ + + integration_id: Required[str] + """Catalog integration ID to attach. + + This is the `id` from the integrations catalog at `/ai/integrations` (the same + value also appears as `integration_id` on entries returned by + `/ai/integrations/connections`). It is **not** the connection-level `id` from + `/ai/integrations/connections`. + """ + + allowed_list: SequenceNotStr[str] + """Optional per-assistant allowlist of integration tool names. + + When omitted or empty, all tools allowed by the connected integration are + available to the assistant. + """ + + +class InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan(TypedDict, total=False): + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. + """ + + on_no_punctuation_seconds: float + """Seconds to wait after the transcript ends without punctuation.""" + + on_number_seconds: float + """Seconds to wait after the transcript ends with a number.""" + + on_punctuation_seconds: float + """Seconds to wait after the transcript ends with punctuation.""" + + +class InterruptionSettingsStartSpeakingPlan(TypedDict, total=False): + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. + """ + + transcription_endpointing_plan: InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use + `transcription.settings.eot_threshold` / `eot_timeout_ms` / + `eager_eot_threshold`. + """ + + wait_seconds: float + """Minimum seconds to wait before the assistant starts speaking.""" + + +class InterruptionSettings(TypedDict, total=False): + """ + Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). + """ + + disable_greeting_interruption: bool + """When true, disables user interruptions while the assistant greeting is playing.""" + + enable: bool + """Whether users can interrupt the assistant while it is speaking.""" + + start_speaking_plan: InterruptionSettingsStartSpeakingPlan + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For + turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the + transcription end-of-turn settings under `transcription.settings` instead. + """ + + +class McpServer(TypedDict, total=False): + """Reference to an MCP server attached to an assistant. + + Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. + """ + + id: Required[str] + """ID of the MCP server to attach. + + This must be the `id` of an MCP server returned by the `/ai/mcp_servers` + endpoints. + """ + + allowed_tools: SequenceNotStr[str] + """Optional per-assistant allowlist of MCP tool names. + + When omitted, the assistant uses the MCP server's configured `allowed_tools`. + """ diff --git a/src/telnyx/types/ai/assistant_integration.py b/src/telnyx/types/ai/assistant_integration.py deleted file mode 100644 index f686769d..00000000 --- a/src/telnyx/types/ai/assistant_integration.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["AssistantIntegration"] - - -class AssistantIntegration(BaseModel): - """Reference to a connected integration attached to an assistant. - - Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. - """ - - integration_id: str - """Catalog integration ID to attach. - - This is the `id` from the integrations catalog at `/ai/integrations` (the same - value also appears as `integration_id` on entries returned by - `/ai/integrations/connections`). It is **not** the connection-level `id` from - `/ai/integrations/connections`. - """ - - allowed_list: Optional[List[str]] = None - """Optional per-assistant allowlist of integration tool names. - - When omitted or empty, all tools allowed by the connected integration are - available to the assistant. - """ diff --git a/src/telnyx/types/ai/assistant_integration_param.py b/src/telnyx/types/ai/assistant_integration_param.py deleted file mode 100644 index 9f8e9a70..00000000 --- a/src/telnyx/types/ai/assistant_integration_param.py +++ /dev/null @@ -1,32 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from ..._types import SequenceNotStr - -__all__ = ["AssistantIntegrationParam"] - - -class AssistantIntegrationParam(TypedDict, total=False): - """Reference to a connected integration attached to an assistant. - - Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. - """ - - integration_id: Required[str] - """Catalog integration ID to attach. - - This is the `id` from the integrations catalog at `/ai/integrations` (the same - value also appears as `integration_id` on entries returned by - `/ai/integrations/connections`). It is **not** the connection-level `id` from - `/ai/integrations/connections`. - """ - - allowed_list: SequenceNotStr[str] - """Optional per-assistant allowlist of integration tool names. - - When omitted or empty, all tools allowed by the connected integration are - available to the assistant. - """ diff --git a/src/telnyx/types/ai/assistant_mcp_server.py b/src/telnyx/types/ai/assistant_mcp_server.py deleted file mode 100644 index c12e8217..00000000 --- a/src/telnyx/types/ai/assistant_mcp_server.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["AssistantMcpServer"] - - -class AssistantMcpServer(BaseModel): - """Reference to an MCP server attached to an assistant. - - Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. - """ - - id: str - """ID of the MCP server to attach. - - This must be the `id` of an MCP server returned by the `/ai/mcp_servers` - endpoints. - """ - - allowed_tools: Optional[List[str]] = None - """Optional per-assistant allowlist of MCP tool names. - - When omitted, the assistant uses the MCP server's configured `allowed_tools`. - """ diff --git a/src/telnyx/types/ai/assistant_mcp_server_param.py b/src/telnyx/types/ai/assistant_mcp_server_param.py deleted file mode 100644 index 520d4696..00000000 --- a/src/telnyx/types/ai/assistant_mcp_server_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from ..._types import SequenceNotStr - -__all__ = ["AssistantMcpServerParam"] - - -class AssistantMcpServerParam(TypedDict, total=False): - """Reference to an MCP server attached to an assistant. - - Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. - """ - - id: Required[str] - """ID of the MCP server to attach. - - This must be the `id` of an MCP server returned by the `/ai/mcp_servers` - endpoints. - """ - - allowed_tools: SequenceNotStr[str] - """Optional per-assistant allowlist of MCP tool names. - - When omitted, the assistant uses the MCP server's configured `allowed_tools`. - """ diff --git a/src/telnyx/types/ai/assistant_tool.py b/src/telnyx/types/ai/assistant_tool.py index b2114271..49137b98 100644 --- a/src/telnyx/types/ai/assistant_tool.py +++ b/src/telnyx/types/ai/assistant_tool.py @@ -18,7 +18,7 @@ "HandoffHandoffAIAssistant", "Transfer", "TransferTransfer", - "TransferTransferTargetsTargetsList", + "TransferTransferTargetsUnionMember0", "TransferTransferCustomHeader", "TransferTransferVoicemailDetection", "TransferTransferVoicemailDetectionDetectionConfig", @@ -27,7 +27,7 @@ "Invite", "InviteInvite", "InviteInviteCustomHeader", - "InviteInviteTargetsTargetsList", + "InviteInviteTargetsUnionMember0", "InviteInviteVoicemailDetection", "InviteInviteVoicemailDetectionOnVoicemailDetected", "Refer", @@ -74,7 +74,7 @@ class Handoff(BaseModel): type: Literal["handoff"] -class TransferTransferTargetsTargetsList(BaseModel): +class TransferTransferTargetsUnionMember0(BaseModel): to: str """The destination number or SIP URI of the call.""" @@ -200,7 +200,7 @@ class TransferTransfer(BaseModel): from_: str = FieldInfo(alias="from") """Number or SIP URI placing the call.""" - targets: Union[List[TransferTransferTargetsTargetsList], str] + targets: Union[List[TransferTransferTargetsUnionMember0], str] """The different possible targets of the transfer. The assistant will be able to choose one of the targets to transfer the call to. @@ -252,7 +252,7 @@ class InviteInviteCustomHeader(BaseModel): """ -class InviteInviteTargetsTargetsList(BaseModel): +class InviteInviteTargetsUnionMember0(BaseModel): to: str """The destination number or SIP URI of the call.""" @@ -290,7 +290,7 @@ class InviteInvite(BaseModel): custom_headers: Optional[List[InviteInviteCustomHeader]] = None """Custom headers to be added to the SIP INVITE for the invite command.""" - targets: Union[List[InviteInviteTargetsTargetsList], str, None] = None + targets: Union[List[InviteInviteTargetsUnionMember0], str, None] = None """The different possible targets of the invite. The assistant will be able to choose one of the targets to invite to the call. diff --git a/src/telnyx/types/ai/assistant_tool_param.py b/src/telnyx/types/ai/assistant_tool_param.py index 620353ba..afeb88fe 100644 --- a/src/telnyx/types/ai/assistant_tool_param.py +++ b/src/telnyx/types/ai/assistant_tool_param.py @@ -16,7 +16,7 @@ "HandoffHandoffAIAssistant", "Transfer", "TransferTransfer", - "TransferTransferTargetsTargetsList", + "TransferTransferTargetsUnionMember0", "TransferTransferCustomHeader", "TransferTransferVoicemailDetection", "TransferTransferVoicemailDetectionDetectionConfig", @@ -25,7 +25,7 @@ "Invite", "InviteInvite", "InviteInviteCustomHeader", - "InviteInviteTargetsTargetsList", + "InviteInviteTargetsUnionMember0", "InviteInviteVoicemailDetection", "InviteInviteVoicemailDetectionOnVoicemailDetected", "Refer", @@ -72,7 +72,7 @@ class Handoff(TypedDict, total=False): type: Required[Literal["handoff"]] -class TransferTransferTargetsTargetsList(TypedDict, total=False): +class TransferTransferTargetsUnionMember0(TypedDict, total=False): to: Required[str] """The destination number or SIP URI of the call.""" @@ -204,7 +204,7 @@ class TransferTransferVoicemailDetection(TypedDict, total=False): class TransferTransfer(_TransferTransferReservedKeywords, total=False): - targets: Required[Union[Iterable[TransferTransferTargetsTargetsList], str]] + targets: Required[Union[Iterable[TransferTransferTargetsUnionMember0], str]] """The different possible targets of the transfer. The assistant will be able to choose one of the targets to transfer the call to. @@ -256,7 +256,7 @@ class InviteInviteCustomHeader(TypedDict, total=False): """ -class InviteInviteTargetsTargetsList(TypedDict, total=False): +class InviteInviteTargetsUnionMember0(TypedDict, total=False): to: Required[str] """The destination number or SIP URI of the call.""" @@ -300,7 +300,7 @@ class InviteInvite(_InviteInviteReservedKeywords, total=False): custom_headers: Iterable[InviteInviteCustomHeader] """Custom headers to be added to the SIP INVITE for the invite command.""" - targets: Union[Iterable[InviteInviteTargetsTargetsList], str, None] + targets: Union[Iterable[InviteInviteTargetsUnionMember0], str, None] """The different possible targets of the invite. The assistant will be able to choose one of the targets to invite to the call. diff --git a/src/telnyx/types/ai/assistant_update_params.py b/src/telnyx/types/ai/assistant_update_params.py index c6c6bbe6..4017b522 100644 --- a/src/telnyx/types/ai/assistant_update_params.py +++ b/src/telnyx/types/ai/assistant_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr from .enabled_features import EnabledFeatures @@ -17,13 +17,17 @@ from .messaging_settings_param import MessagingSettingsParam from .telephony_settings_param import TelephonySettingsParam from .fallback_config_req_param import FallbackConfigReqParam -from .assistant_mcp_server_param import AssistantMcpServerParam -from .assistant_integration_param import AssistantIntegrationParam from .transcription_settings_param import TranscriptionSettingsParam from .post_conversation_settings_req_param import PostConversationSettingsReqParam -from .inference_embedding_interruption_settings_param import InferenceEmbeddingInterruptionSettingsParam -__all__ = ["AssistantUpdateParams"] +__all__ = [ + "AssistantUpdateParams", + "Integration", + "InterruptionSettings", + "InterruptionSettingsStartSpeakingPlan", + "InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan", + "McpServer", +] class AssistantUpdateParams(TypedDict, total=False): @@ -77,7 +81,7 @@ class AssistantUpdateParams(TypedDict, total=False): [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables) """ - integrations: Iterable[AssistantIntegrationParam] + integrations: Iterable[Integration] """Connected integrations attached to the assistant. The catalog of available integrations is at `/ai/integrations`; the user's @@ -85,7 +89,7 @@ class AssistantUpdateParams(TypedDict, total=False): references a catalog integration by `integration_id`. """ - interruption_settings: InferenceEmbeddingInterruptionSettingsParam + interruption_settings: InterruptionSettings """ Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking @@ -105,7 +109,7 @@ class AssistantUpdateParams(TypedDict, total=False): are unlikely to work with this integration. """ - mcp_servers: Iterable[AssistantMcpServerParam] + mcp_servers: Iterable[McpServer] """MCP servers attached to the assistant. Create MCP servers with `/ai/mcp_servers`, then reference them by `id` here. @@ -175,3 +179,100 @@ class AssistantUpdateParams(TypedDict, total=False): widget_settings: WidgetSettingsParam """Configuration settings for the assistant's web widget.""" + + +class Integration(TypedDict, total=False): + """Reference to a connected integration attached to an assistant. + + Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. + """ + + integration_id: Required[str] + """Catalog integration ID to attach. + + This is the `id` from the integrations catalog at `/ai/integrations` (the same + value also appears as `integration_id` on entries returned by + `/ai/integrations/connections`). It is **not** the connection-level `id` from + `/ai/integrations/connections`. + """ + + allowed_list: SequenceNotStr[str] + """Optional per-assistant allowlist of integration tool names. + + When omitted or empty, all tools allowed by the connected integration are + available to the assistant. + """ + + +class InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan(TypedDict, total=False): + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. + """ + + on_no_punctuation_seconds: float + """Seconds to wait after the transcript ends without punctuation.""" + + on_number_seconds: float + """Seconds to wait after the transcript ends with a number.""" + + on_punctuation_seconds: float + """Seconds to wait after the transcript ends with punctuation.""" + + +class InterruptionSettingsStartSpeakingPlan(TypedDict, total=False): + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. + """ + + transcription_endpointing_plan: InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use + `transcription.settings.eot_threshold` / `eot_timeout_ms` / + `eager_eot_threshold`. + """ + + wait_seconds: float + """Minimum seconds to wait before the assistant starts speaking.""" + + +class InterruptionSettings(TypedDict, total=False): + """ + Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). + """ + + disable_greeting_interruption: bool + """When true, disables user interruptions while the assistant greeting is playing.""" + + enable: bool + """Whether users can interrupt the assistant while it is speaking.""" + + start_speaking_plan: InterruptionSettingsStartSpeakingPlan + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For + turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the + transcription end-of-turn settings under `transcription.settings` instead. + """ + + +class McpServer(TypedDict, total=False): + """Reference to an MCP server attached to an assistant. + + Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. + """ + + id: Required[str] + """ID of the MCP server to attach. + + This must be the `id` of an MCP server returned by the `/ai/mcp_servers` + endpoints. + """ + + allowed_tools: SequenceNotStr[str] + """Optional per-assistant allowlist of MCP tool names. + + When omitted, the assistant uses the MCP server's configured `allowed_tools`. + """ diff --git a/src/telnyx/types/ai/assistants/__init__.py b/src/telnyx/types/ai/assistants/__init__.py index 3e584a53..406ed42f 100644 --- a/src/telnyx/types/ai/assistants/__init__.py +++ b/src/telnyx/types/ai/assistants/__init__.py @@ -2,21 +2,13 @@ from __future__ import annotations -from .serve import Serve as Serve -from .clause import Clause as Clause -from .rule_output import RuleOutput as RuleOutput -from .serve_param import ServeParam as ServeParam -from .clause_param import ClauseParam as ClauseParam from .event_status import EventStatus as EventStatus -from .rollout_slot import RolloutSlot as RolloutSlot from .assistant_test import AssistantTest as AssistantTest from .tag_add_params import TagAddParams as TagAddParams -from .rule_input_param import RuleInputParam as RuleInputParam from .tag_add_response import TagAddResponse as TagAddResponse from .test_list_params import TestListParams as TestListParams from .tool_test_params import ToolTestParams as ToolTestParams from .tag_list_response import TagListResponse as TagListResponse -from .rollout_slot_param import RolloutSlotParam as RolloutSlotParam from .test_create_params import TestCreateParams as TestCreateParams from .test_update_params import TestUpdateParams as TestUpdateParams from .tool_test_response import ToolTestResponse as ToolTestResponse diff --git a/src/telnyx/types/ai/assistants/canary_deploy_create_params.py b/src/telnyx/types/ai/assistants/canary_deploy_create_params.py index 98f22d12..df481a3f 100644 --- a/src/telnyx/types/ai/assistants/canary_deploy_create_params.py +++ b/src/telnyx/types/ai/assistants/canary_deploy_create_params.py @@ -3,12 +3,69 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, TypedDict -from .rule_input_param import RuleInputParam +from ...._types import SequenceNotStr -__all__ = ["CanaryDeployCreateParams"] +__all__ = ["CanaryDeployCreateParams", "Rule", "RuleServe", "RuleServeRollout", "RuleMatch"] class CanaryDeployCreateParams(TypedDict, total=False): - rules: Iterable[RuleInputParam] + rules: Iterable[Rule] + + +class RuleServeRollout(TypedDict, total=False): + """One slot in a percentage rollout.""" + + version_id: Required[str] + + weight: Required[float] + + +class RuleServe(TypedDict, total=False): + """What a rule serves when matched. + + Exactly one of: + - ``version_id`` — serve a specific version + - ``rollout`` — weighted random across versions; weights must sum to + less than 100, with the leftover routing to the main version + """ + + rollout: Iterable[RuleServeRollout] + + version_id: str + + +class RuleMatch(TypedDict, total=False): + """A single attribute/operator/values check. + + A clause matches when the routing context's value for ``attribute`` + satisfies ``operator`` against any of ``values``. + """ + + attribute: Required[str] + """Attribute name from the routing context""" + + operator: Required[Literal["in", "not_in", "starts_with"]] + """Match operator""" + + values: Required[SequenceNotStr[str]] + + +class Rule(TypedDict, total=False): + """A targeting rule: ``match`` clauses (AND) gate ``serve``. + + An empty ``match`` is a catch-all (always fires). + """ + + serve: Required[RuleServe] + """What a rule serves when matched. + + Exactly one of: + + - `version_id` — serve a specific version + - `rollout` — weighted random across versions; weights must sum to less than + 100, with the leftover routing to the main version + """ + + match: Iterable[RuleMatch] diff --git a/src/telnyx/types/ai/assistants/canary_deploy_response.py b/src/telnyx/types/ai/assistants/canary_deploy_response.py index 86975189..7c649bbf 100644 --- a/src/telnyx/types/ai/assistants/canary_deploy_response.py +++ b/src/telnyx/types/ai/assistants/canary_deploy_response.py @@ -1,12 +1,69 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ...._models import BaseModel -from .rule_output import RuleOutput -__all__ = ["CanaryDeployResponse"] +__all__ = ["CanaryDeployResponse", "Rule", "RuleServe", "RuleServeRollout", "RuleMatch"] + + +class RuleServeRollout(BaseModel): + """One slot in a percentage rollout.""" + + version_id: str + + weight: float + + +class RuleServe(BaseModel): + """What a rule serves when matched. + + Exactly one of: + - ``version_id`` — serve a specific version + - ``rollout`` — weighted random across versions; weights must sum to + less than 100, with the leftover routing to the main version + """ + + rollout: Optional[List[RuleServeRollout]] = None + + version_id: Optional[str] = None + + +class RuleMatch(BaseModel): + """A single attribute/operator/values check. + + A clause matches when the routing context's value for ``attribute`` + satisfies ``operator`` against any of ``values``. + """ + + attribute: str + """Attribute name from the routing context""" + + operator: Literal["in", "not_in", "starts_with"] + """Match operator""" + + values: List[str] + + +class Rule(BaseModel): + """A targeting rule: ``match`` clauses (AND) gate ``serve``. + + An empty ``match`` is a catch-all (always fires). + """ + + serve: RuleServe + """What a rule serves when matched. + + Exactly one of: + + - `version_id` — serve a specific version + - `rollout` — weighted random across versions; weights must sum to less than + 100, with the leftover routing to the main version + """ + + match: Optional[List[RuleMatch]] = None class CanaryDeployResponse(BaseModel): @@ -19,6 +76,6 @@ class CanaryDeployResponse(BaseModel): created_at: datetime - rules: List[RuleOutput] + rules: List[Rule] updated_at: datetime diff --git a/src/telnyx/types/ai/assistants/canary_deploy_update_params.py b/src/telnyx/types/ai/assistants/canary_deploy_update_params.py index 28148415..c2c4a85f 100644 --- a/src/telnyx/types/ai/assistants/canary_deploy_update_params.py +++ b/src/telnyx/types/ai/assistants/canary_deploy_update_params.py @@ -3,12 +3,69 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, TypedDict -from .rule_input_param import RuleInputParam +from ...._types import SequenceNotStr -__all__ = ["CanaryDeployUpdateParams"] +__all__ = ["CanaryDeployUpdateParams", "Rule", "RuleServe", "RuleServeRollout", "RuleMatch"] class CanaryDeployUpdateParams(TypedDict, total=False): - rules: Iterable[RuleInputParam] + rules: Iterable[Rule] + + +class RuleServeRollout(TypedDict, total=False): + """One slot in a percentage rollout.""" + + version_id: Required[str] + + weight: Required[float] + + +class RuleServe(TypedDict, total=False): + """What a rule serves when matched. + + Exactly one of: + - ``version_id`` — serve a specific version + - ``rollout`` — weighted random across versions; weights must sum to + less than 100, with the leftover routing to the main version + """ + + rollout: Iterable[RuleServeRollout] + + version_id: str + + +class RuleMatch(TypedDict, total=False): + """A single attribute/operator/values check. + + A clause matches when the routing context's value for ``attribute`` + satisfies ``operator`` against any of ``values``. + """ + + attribute: Required[str] + """Attribute name from the routing context""" + + operator: Required[Literal["in", "not_in", "starts_with"]] + """Match operator""" + + values: Required[SequenceNotStr[str]] + + +class Rule(TypedDict, total=False): + """A targeting rule: ``match`` clauses (AND) gate ``serve``. + + An empty ``match`` is a catch-all (always fires). + """ + + serve: Required[RuleServe] + """What a rule serves when matched. + + Exactly one of: + + - `version_id` — serve a specific version + - `rollout` — weighted random across versions; weights must sum to less than + 100, with the leftover routing to the main version + """ + + match: Iterable[RuleMatch] diff --git a/src/telnyx/types/ai/assistants/clause.py b/src/telnyx/types/ai/assistants/clause.py deleted file mode 100644 index 45adbc16..00000000 --- a/src/telnyx/types/ai/assistants/clause.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["Clause"] - - -class Clause(BaseModel): - """A single attribute/operator/values check. - - A clause matches when the routing context's value for ``attribute`` - satisfies ``operator`` against any of ``values``. - """ - - attribute: str - """Attribute name from the routing context""" - - operator: Literal["in", "not_in", "starts_with"] - """Match operator""" - - values: List[str] diff --git a/src/telnyx/types/ai/assistants/clause_param.py b/src/telnyx/types/ai/assistants/clause_param.py deleted file mode 100644 index 9686b62d..00000000 --- a/src/telnyx/types/ai/assistants/clause_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -from ...._types import SequenceNotStr - -__all__ = ["ClauseParam"] - - -class ClauseParam(TypedDict, total=False): - """A single attribute/operator/values check. - - A clause matches when the routing context's value for ``attribute`` - satisfies ``operator`` against any of ``values``. - """ - - attribute: Required[str] - """Attribute name from the routing context""" - - operator: Required[Literal["in", "not_in", "starts_with"]] - """Match operator""" - - values: Required[SequenceNotStr[str]] diff --git a/src/telnyx/types/ai/assistants/rollout_slot.py b/src/telnyx/types/ai/assistants/rollout_slot.py deleted file mode 100644 index 7e79586b..00000000 --- a/src/telnyx/types/ai/assistants/rollout_slot.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ...._models import BaseModel - -__all__ = ["RolloutSlot"] - - -class RolloutSlot(BaseModel): - """One slot in a percentage rollout.""" - - version_id: str - - weight: float diff --git a/src/telnyx/types/ai/assistants/rollout_slot_param.py b/src/telnyx/types/ai/assistants/rollout_slot_param.py deleted file mode 100644 index b793001a..00000000 --- a/src/telnyx/types/ai/assistants/rollout_slot_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RolloutSlotParam"] - - -class RolloutSlotParam(TypedDict, total=False): - """One slot in a percentage rollout.""" - - version_id: Required[str] - - weight: Required[float] diff --git a/src/telnyx/types/ai/assistants/rule_input_param.py b/src/telnyx/types/ai/assistants/rule_input_param.py deleted file mode 100644 index 05f3d15d..00000000 --- a/src/telnyx/types/ai/assistants/rule_input_param.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -from .serve_param import ServeParam -from .clause_param import ClauseParam - -__all__ = ["RuleInputParam"] - - -class RuleInputParam(TypedDict, total=False): - """A targeting rule: ``match`` clauses (AND) gate ``serve``. - - An empty ``match`` is a catch-all (always fires). - """ - - serve: Required[ServeParam] - """What a rule serves when matched. - - Exactly one of: - - - `version_id` — serve a specific version - - `rollout` — weighted random across versions; weights must sum to less than - 100, with the leftover routing to the main version - """ - - match: Iterable[ClauseParam] diff --git a/src/telnyx/types/ai/assistants/rule_output.py b/src/telnyx/types/ai/assistants/rule_output.py deleted file mode 100644 index d445b592..00000000 --- a/src/telnyx/types/ai/assistants/rule_output.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .serve import Serve -from .clause import Clause -from ...._models import BaseModel - -__all__ = ["RuleOutput"] - - -class RuleOutput(BaseModel): - """A targeting rule: ``match`` clauses (AND) gate ``serve``. - - An empty ``match`` is a catch-all (always fires). - """ - - serve: Serve - """What a rule serves when matched. - - Exactly one of: - - - `version_id` — serve a specific version - - `rollout` — weighted random across versions; weights must sum to less than - 100, with the leftover routing to the main version - """ - - match: Optional[List[Clause]] = None diff --git a/src/telnyx/types/ai/assistants/serve.py b/src/telnyx/types/ai/assistants/serve.py deleted file mode 100644 index be641a46..00000000 --- a/src/telnyx/types/ai/assistants/serve.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ...._models import BaseModel -from .rollout_slot import RolloutSlot - -__all__ = ["Serve"] - - -class Serve(BaseModel): - """What a rule serves when matched. - - Exactly one of: - - ``version_id`` — serve a specific version - - ``rollout`` — weighted random across versions; weights must sum to - less than 100, with the leftover routing to the main version - """ - - rollout: Optional[List[RolloutSlot]] = None - - version_id: Optional[str] = None diff --git a/src/telnyx/types/ai/assistants/serve_param.py b/src/telnyx/types/ai/assistants/serve_param.py deleted file mode 100644 index 167c02a7..00000000 --- a/src/telnyx/types/ai/assistants/serve_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import TypedDict - -from .rollout_slot_param import RolloutSlotParam - -__all__ = ["ServeParam"] - - -class ServeParam(TypedDict, total=False): - """What a rule serves when matched. - - Exactly one of: - - ``version_id`` — serve a specific version - - ``rollout`` — weighted random across versions; weights must sum to - less than 100, with the leftover routing to the main version - """ - - rollout: Iterable[RolloutSlotParam] - - version_id: str diff --git a/src/telnyx/types/ai/assistants/version_update_params.py b/src/telnyx/types/ai/assistants/version_update_params.py index e0ff8f51..5017b165 100644 --- a/src/telnyx/types/ai/assistants/version_update_params.py +++ b/src/telnyx/types/ai/assistants/version_update_params.py @@ -17,13 +17,17 @@ from ..messaging_settings_param import MessagingSettingsParam from ..telephony_settings_param import TelephonySettingsParam from ..fallback_config_req_param import FallbackConfigReqParam -from ..assistant_mcp_server_param import AssistantMcpServerParam -from ..assistant_integration_param import AssistantIntegrationParam from ..transcription_settings_param import TranscriptionSettingsParam from ..post_conversation_settings_req_param import PostConversationSettingsReqParam -from ..inference_embedding_interruption_settings_param import InferenceEmbeddingInterruptionSettingsParam -__all__ = ["VersionUpdateParams"] +__all__ = [ + "VersionUpdateParams", + "Integration", + "InterruptionSettings", + "InterruptionSettingsStartSpeakingPlan", + "InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan", + "McpServer", +] class VersionUpdateParams(TypedDict, total=False): @@ -79,7 +83,7 @@ class VersionUpdateParams(TypedDict, total=False): [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables) """ - integrations: Iterable[AssistantIntegrationParam] + integrations: Iterable[Integration] """Connected integrations attached to the assistant. The catalog of available integrations is at `/ai/integrations`; the user's @@ -87,7 +91,7 @@ class VersionUpdateParams(TypedDict, total=False): references a catalog integration by `integration_id`. """ - interruption_settings: InferenceEmbeddingInterruptionSettingsParam + interruption_settings: InterruptionSettings """ Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking @@ -107,7 +111,7 @@ class VersionUpdateParams(TypedDict, total=False): are unlikely to work with this integration. """ - mcp_servers: Iterable[AssistantMcpServerParam] + mcp_servers: Iterable[McpServer] """MCP servers attached to the assistant. Create MCP servers with `/ai/mcp_servers`, then reference them by `id` here. @@ -171,3 +175,100 @@ class VersionUpdateParams(TypedDict, total=False): widget_settings: WidgetSettingsParam """Configuration settings for the assistant's web widget.""" + + +class Integration(TypedDict, total=False): + """Reference to a connected integration attached to an assistant. + + Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. + """ + + integration_id: Required[str] + """Catalog integration ID to attach. + + This is the `id` from the integrations catalog at `/ai/integrations` (the same + value also appears as `integration_id` on entries returned by + `/ai/integrations/connections`). It is **not** the connection-level `id` from + `/ai/integrations/connections`. + """ + + allowed_list: SequenceNotStr[str] + """Optional per-assistant allowlist of integration tool names. + + When omitted or empty, all tools allowed by the connected integration are + available to the assistant. + """ + + +class InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan(TypedDict, total=False): + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. + """ + + on_no_punctuation_seconds: float + """Seconds to wait after the transcript ends without punctuation.""" + + on_number_seconds: float + """Seconds to wait after the transcript ends with a number.""" + + on_punctuation_seconds: float + """Seconds to wait after the transcript ends with punctuation.""" + + +class InterruptionSettingsStartSpeakingPlan(TypedDict, total=False): + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. + """ + + transcription_endpointing_plan: InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use + `transcription.settings.eot_threshold` / `eot_timeout_ms` / + `eager_eot_threshold`. + """ + + wait_seconds: float + """Minimum seconds to wait before the assistant starts speaking.""" + + +class InterruptionSettings(TypedDict, total=False): + """ + Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). + """ + + disable_greeting_interruption: bool + """When true, disables user interruptions while the assistant greeting is playing.""" + + enable: bool + """Whether users can interrupt the assistant while it is speaking.""" + + start_speaking_plan: InterruptionSettingsStartSpeakingPlan + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For + turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the + transcription end-of-turn settings under `transcription.settings` instead. + """ + + +class McpServer(TypedDict, total=False): + """Reference to an MCP server attached to an assistant. + + Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. + """ + + id: Required[str] + """ID of the MCP server to attach. + + This must be the `id` of an MCP server returned by the `/ai/mcp_servers` + endpoints. + """ + + allowed_tools: SequenceNotStr[str] + """Optional per-assistant allowlist of MCP tool names. + + When omitted, the assistant uses the MCP server's configured `allowed_tools`. + """ diff --git a/src/telnyx/types/ai/inference_embedding.py b/src/telnyx/types/ai/inference_embedding.py index ac37ba37..81ff13c5 100644 --- a/src/telnyx/types/ai/inference_embedding.py +++ b/src/telnyx/types/ai/inference_embedding.py @@ -16,13 +16,114 @@ from .privacy_settings import PrivacySettings from .messaging_settings import MessagingSettings from .telephony_settings import TelephonySettings -from .assistant_mcp_server import AssistantMcpServer -from .assistant_integration import AssistantIntegration from .transcription_settings import TranscriptionSettings from .post_conversation_settings import PostConversationSettings -from .inference_embedding_interruption_settings import InferenceEmbeddingInterruptionSettings -__all__ = ["InferenceEmbedding"] +__all__ = [ + "InferenceEmbedding", + "Integration", + "InterruptionSettings", + "InterruptionSettingsStartSpeakingPlan", + "InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan", + "McpServer", +] + + +class Integration(BaseModel): + """Reference to a connected integration attached to an assistant. + + Discover available integrations with `/ai/integrations` and connected integrations with `/ai/integrations/connections`. + """ + + integration_id: str + """Catalog integration ID to attach. + + This is the `id` from the integrations catalog at `/ai/integrations` (the same + value also appears as `integration_id` on entries returned by + `/ai/integrations/connections`). It is **not** the connection-level `id` from + `/ai/integrations/connections`. + """ + + allowed_list: Optional[List[str]] = None + """Optional per-assistant allowlist of integration tool names. + + When omitted or empty, all tools allowed by the connected integration are + available to the assistant. + """ + + +class InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan(BaseModel): + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. + """ + + on_no_punctuation_seconds: Optional[float] = None + """Seconds to wait after the transcript ends without punctuation.""" + + on_number_seconds: Optional[float] = None + """Seconds to wait after the transcript ends with a number.""" + + on_punctuation_seconds: Optional[float] = None + """Seconds to wait after the transcript ends with punctuation.""" + + +class InterruptionSettingsStartSpeakingPlan(BaseModel): + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. + """ + + transcription_endpointing_plan: Optional[InterruptionSettingsStartSpeakingPlanTranscriptionEndpointingPlan] = None + """Endpointing thresholds used to decide when the user has finished speaking. + + Applies to non turn-taking transcription models. For `deepgram/flux`, use + `transcription.settings.eot_threshold` / `eot_timeout_ms` / + `eager_eot_threshold`. + """ + + wait_seconds: Optional[float] = None + """Minimum seconds to wait before the assistant starts speaking.""" + + +class InterruptionSettings(BaseModel): + """ + Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). + """ + + disable_greeting_interruption: Optional[bool] = None + """When true, disables user interruptions while the assistant greeting is playing.""" + + enable: Optional[bool] = None + """Whether users can interrupt the assistant while it is speaking.""" + + start_speaking_plan: Optional[InterruptionSettingsStartSpeakingPlan] = None + """Controls when the assistant starts speaking after the user stops. + + These thresholds primarily apply to non turn-taking transcription models. For + turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the + transcription end-of-turn settings under `transcription.settings` instead. + """ + + +class McpServer(BaseModel): + """Reference to an MCP server attached to an assistant. + + Create and manage MCP servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by ID. + """ + + id: str + """ID of the MCP server to attach. + + This must be the `id` of an MCP server returned by the `/ai/mcp_servers` + endpoints. + """ + + allowed_tools: Optional[List[str]] = None + """Optional per-assistant allowlist of MCP tool names. + + When omitted, the assistant uses the MCP server's configured `allowed_tools`. + """ class InferenceEmbedding(BaseModel): @@ -94,7 +195,7 @@ class InferenceEmbedding(BaseModel): insight_settings: Optional[InsightSettings] = None - integrations: Optional[List[AssistantIntegration]] = None + integrations: Optional[List[Integration]] = None """Connected integrations attached to the assistant. The catalog of available integrations is at `/ai/integrations`; the user's @@ -102,7 +203,7 @@ class InferenceEmbedding(BaseModel): references a catalog integration by `integration_id`. """ - interruption_settings: Optional[InferenceEmbeddingInterruptionSettings] = None + interruption_settings: Optional[InterruptionSettings] = None """ Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking @@ -122,7 +223,7 @@ class InferenceEmbedding(BaseModel): are unlikely to work with this integration. """ - mcp_servers: Optional[List[AssistantMcpServer]] = None + mcp_servers: Optional[List[McpServer]] = None """MCP servers attached to the assistant. Create MCP servers with `/ai/mcp_servers`, then reference them by `id` here. diff --git a/src/telnyx/types/ai/inference_embedding_interruption_settings.py b/src/telnyx/types/ai/inference_embedding_interruption_settings.py deleted file mode 100644 index b7a216ee..00000000 --- a/src/telnyx/types/ai/inference_embedding_interruption_settings.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .start_speaking_plan import StartSpeakingPlan - -__all__ = ["InferenceEmbeddingInterruptionSettings"] - - -class InferenceEmbeddingInterruptionSettings(BaseModel): - """ - Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). - """ - - disable_greeting_interruption: Optional[bool] = None - """When true, disables user interruptions while the assistant greeting is playing.""" - - enable: Optional[bool] = None - """Whether users can interrupt the assistant while it is speaking.""" - - start_speaking_plan: Optional[StartSpeakingPlan] = None - """Controls when the assistant starts speaking after the user stops. - - These thresholds primarily apply to non turn-taking transcription models. For - turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the - transcription end-of-turn settings under `transcription.settings` instead. - """ diff --git a/src/telnyx/types/ai/inference_embedding_interruption_settings_param.py b/src/telnyx/types/ai/inference_embedding_interruption_settings_param.py deleted file mode 100644 index 25a9c767..00000000 --- a/src/telnyx/types/ai/inference_embedding_interruption_settings_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .start_speaking_plan_param import StartSpeakingPlanParam - -__all__ = ["InferenceEmbeddingInterruptionSettingsParam"] - - -class InferenceEmbeddingInterruptionSettingsParam(TypedDict, total=False): - """ - Settings for interruptions and how the assistant decides the user has finished speaking. These timings are most relevant when using non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn behavior is controlled by the transcription end-of-turn settings under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`, `eager_eot_threshold`). - """ - - disable_greeting_interruption: bool - """When true, disables user interruptions while the assistant greeting is playing.""" - - enable: bool - """Whether users can interrupt the assistant while it is speaking.""" - - start_speaking_plan: StartSpeakingPlanParam - """Controls when the assistant starts speaking after the user stops. - - These thresholds primarily apply to non turn-taking transcription models. For - turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the - transcription end-of-turn settings under `transcription.settings` instead. - """ diff --git a/src/telnyx/types/ai/openai_list_models_response.py b/src/telnyx/types/ai/openai_list_models_response.py index 6710b3cd..d3eb4b54 100644 --- a/src/telnyx/types/ai/openai_list_models_response.py +++ b/src/telnyx/types/ai/openai_list_models_response.py @@ -1,14 +1,130 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -from ..model_metadata import ModelMetadata -__all__ = ["OpenAIListModelsResponse"] +__all__ = ["OpenAIListModelsResponse", "Data"] + + +class Data(BaseModel): + """Metadata for a model available on Telnyx Inference. + + Returned by `GET /v2/ai/openai/models` (and the deprecated `GET /v2/ai/models`). Open-source models live under their Hugging Face organization (e.g. `moonshotai/Kimi-K2.6`, `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`); fine-tuned models are owned by the Telnyx organization that trained them. + """ + + id: str + """Model identifier. + + For open-source models, follows the `{organization}/{model_name}` convention + from Hugging Face (e.g. `moonshotai/Kimi-K2.6`). + """ + + context_length: int + """ + Maximum total tokens (prompt + completion) supported by the model in a single + request. + """ + + created: datetime + """Timestamp at which the model was registered on Telnyx Inference (ISO 8601).""" + + languages: List[str] + """ISO language codes the model supports (e.g. `en`, `es`).""" + + license: str + """License the model is distributed under, e.g. + + `Apache 2.0`, `MIT`, `Llama 3 Community License`. + """ + + organization: str + """ + Organization that originally published the model, matching the prefix of `id` + for open-source models. + """ + + owned_by: str + """Owner of the model. + + `Telnyx` for Telnyx-hosted open-source models, the upstream provider name for + proxied models, or the Telnyx organization id for fine-tuned models. + """ + + parameters: int + """Total parameter count of the model.""" + + tier: Literal["small", "medium", "large", "unlisted"] + """Billing tier the model belongs to. + + Used together with `pricing` to determine cost per 1M tokens. + """ + + base_model: Optional[str] = None + """Base model the fine-tuned model was trained from. + + Only set for fine-tuned models. + """ + + description: Optional[str] = None + """Short, human-readable summary of what the model is best suited for.""" + + is_fine_tunable: Optional[bool] = None + """ + Whether the model can be used as a base for a fine-tuning job via + `POST /v2/ai/fine_tuning/jobs`. + """ + + is_vision_supported: Optional[bool] = None + """ + Whether the model accepts image inputs in chat completions (multimodal vision + support). + """ + + max_completion_tokens: Optional[int] = None + """Maximum number of completion (output) tokens the model will generate per + request. + + `null` if unconstrained beyond `context_length`. + """ + + object: Optional[str] = None + """Object type. Always `model`.""" + + parameters_str: Optional[str] = None + """Human-readable parameter count, e.g. `1.0T`, `753.9B`, `8B`.""" + + pricing: Optional[Dict[str, str]] = None + """Mapping of token kind to price, as strings to preserve precision. + + Typical keys are `prompt`, `cached_prompt`, and `completion`. When pricing is + available the block also includes `currency` (ISO 4217 code matching the + account's configured billing currency) and `unit` (the denomination the prices + are quoted in, currently always `1M_tokens` for token-priced models). + """ + + recommended_for_assistants: Optional[bool] = None + """ + Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI + Assistant. + """ + + regions: Optional[List[str]] = None + """Public region names where the model is currently deployed (e.g. + + `us-central-1`, `eu-central-1`). + """ + + task: Optional[str] = None + """Primary task the model is intended for, e.g. + + `text-generation`, `audio-text-to-text`, `feature-extraction` (embeddings). + """ class OpenAIListModelsResponse(BaseModel): - data: List[ModelMetadata] + data: List[Data] object: Optional[str] = None diff --git a/src/telnyx/types/ai/start_speaking_plan.py b/src/telnyx/types/ai/start_speaking_plan.py deleted file mode 100644 index 318e8b41..00000000 --- a/src/telnyx/types/ai/start_speaking_plan.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .transcription_endpointing_plan import TranscriptionEndpointingPlan - -__all__ = ["StartSpeakingPlan"] - - -class StartSpeakingPlan(BaseModel): - """Controls when the assistant starts speaking after the user stops. - - These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. - """ - - transcription_endpointing_plan: Optional[TranscriptionEndpointingPlan] = None - """Endpointing thresholds used to decide when the user has finished speaking. - - Applies to non turn-taking transcription models. For `deepgram/flux`, use - `transcription.settings.eot_threshold` / `eot_timeout_ms` / - `eager_eot_threshold`. - """ - - wait_seconds: Optional[float] = None - """Minimum seconds to wait before the assistant starts speaking.""" diff --git a/src/telnyx/types/ai/start_speaking_plan_param.py b/src/telnyx/types/ai/start_speaking_plan_param.py deleted file mode 100644 index eddc939e..00000000 --- a/src/telnyx/types/ai/start_speaking_plan_param.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .transcription_endpointing_plan_param import TranscriptionEndpointingPlanParam - -__all__ = ["StartSpeakingPlanParam"] - - -class StartSpeakingPlanParam(TypedDict, total=False): - """Controls when the assistant starts speaking after the user stops. - - These thresholds primarily apply to non turn-taking transcription models. For turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the transcription end-of-turn settings under `transcription.settings` instead. - """ - - transcription_endpointing_plan: TranscriptionEndpointingPlanParam - """Endpointing thresholds used to decide when the user has finished speaking. - - Applies to non turn-taking transcription models. For `deepgram/flux`, use - `transcription.settings.eot_threshold` / `eot_timeout_ms` / - `eager_eot_threshold`. - """ - - wait_seconds: float - """Minimum seconds to wait before the assistant starts speaking.""" diff --git a/src/telnyx/types/ai/transcription_endpointing_plan.py b/src/telnyx/types/ai/transcription_endpointing_plan.py deleted file mode 100644 index b8db019b..00000000 --- a/src/telnyx/types/ai/transcription_endpointing_plan.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["TranscriptionEndpointingPlan"] - - -class TranscriptionEndpointingPlan(BaseModel): - """Endpointing thresholds used to decide when the user has finished speaking. - - Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. - """ - - on_no_punctuation_seconds: Optional[float] = None - """Seconds to wait after the transcript ends without punctuation.""" - - on_number_seconds: Optional[float] = None - """Seconds to wait after the transcript ends with a number.""" - - on_punctuation_seconds: Optional[float] = None - """Seconds to wait after the transcript ends with punctuation.""" diff --git a/src/telnyx/types/ai/transcription_endpointing_plan_param.py b/src/telnyx/types/ai/transcription_endpointing_plan_param.py deleted file mode 100644 index 7cb66dc7..00000000 --- a/src/telnyx/types/ai/transcription_endpointing_plan_param.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["TranscriptionEndpointingPlanParam"] - - -class TranscriptionEndpointingPlanParam(TypedDict, total=False): - """Endpointing thresholds used to decide when the user has finished speaking. - - Applies to non turn-taking transcription models. For `deepgram/flux`, use `transcription.settings.eot_threshold` / `eot_timeout_ms` / `eager_eot_threshold`. - """ - - on_no_punctuation_seconds: float - """Seconds to wait after the transcript ends without punctuation.""" - - on_number_seconds: float - """Seconds to wait after the transcript ends with a number.""" - - on_punctuation_seconds: float - """Seconds to wait after the transcript ends with punctuation.""" diff --git a/src/telnyx/types/ai/transfer_tool_param.py b/src/telnyx/types/ai/transfer_tool_param.py index d8d95a8f..67d21b67 100644 --- a/src/telnyx/types/ai/transfer_tool_param.py +++ b/src/telnyx/types/ai/transfer_tool_param.py @@ -5,10 +5,10 @@ from typing import Union, Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["TransferToolParam", "Transfer", "TransferTargetsTargetsList"] +__all__ = ["TransferToolParam", "Transfer", "TransferTargetsUnionMember0"] -class TransferTargetsTargetsList(TypedDict, total=False): +class TransferTargetsUnionMember0(TypedDict, total=False): to: Required[str] """The destination number or SIP URI of the call.""" @@ -26,7 +26,7 @@ class TransferTargetsTargetsList(TypedDict, total=False): class Transfer(_TransferReservedKeywords, total=False): - targets: Required[Union[Iterable[TransferTargetsTargetsList], str]] + targets: Required[Union[Iterable[TransferTargetsUnionMember0], str]] """The different possible targets of the transfer. The assistant will be able to choose one of the targets to transfer the call to. diff --git a/src/telnyx/types/ai_retrieve_models_response.py b/src/telnyx/types/ai_retrieve_models_response.py index db67e0f0..30331107 100644 --- a/src/telnyx/types/ai_retrieve_models_response.py +++ b/src/telnyx/types/ai_retrieve_models_response.py @@ -1,14 +1,130 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal from .._models import BaseModel -from .model_metadata import ModelMetadata -__all__ = ["AIRetrieveModelsResponse"] +__all__ = ["AIRetrieveModelsResponse", "Data"] + + +class Data(BaseModel): + """Metadata for a model available on Telnyx Inference. + + Returned by `GET /v2/ai/openai/models` (and the deprecated `GET /v2/ai/models`). Open-source models live under their Hugging Face organization (e.g. `moonshotai/Kimi-K2.6`, `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`); fine-tuned models are owned by the Telnyx organization that trained them. + """ + + id: str + """Model identifier. + + For open-source models, follows the `{organization}/{model_name}` convention + from Hugging Face (e.g. `moonshotai/Kimi-K2.6`). + """ + + context_length: int + """ + Maximum total tokens (prompt + completion) supported by the model in a single + request. + """ + + created: datetime + """Timestamp at which the model was registered on Telnyx Inference (ISO 8601).""" + + languages: List[str] + """ISO language codes the model supports (e.g. `en`, `es`).""" + + license: str + """License the model is distributed under, e.g. + + `Apache 2.0`, `MIT`, `Llama 3 Community License`. + """ + + organization: str + """ + Organization that originally published the model, matching the prefix of `id` + for open-source models. + """ + + owned_by: str + """Owner of the model. + + `Telnyx` for Telnyx-hosted open-source models, the upstream provider name for + proxied models, or the Telnyx organization id for fine-tuned models. + """ + + parameters: int + """Total parameter count of the model.""" + + tier: Literal["small", "medium", "large", "unlisted"] + """Billing tier the model belongs to. + + Used together with `pricing` to determine cost per 1M tokens. + """ + + base_model: Optional[str] = None + """Base model the fine-tuned model was trained from. + + Only set for fine-tuned models. + """ + + description: Optional[str] = None + """Short, human-readable summary of what the model is best suited for.""" + + is_fine_tunable: Optional[bool] = None + """ + Whether the model can be used as a base for a fine-tuning job via + `POST /v2/ai/fine_tuning/jobs`. + """ + + is_vision_supported: Optional[bool] = None + """ + Whether the model accepts image inputs in chat completions (multimodal vision + support). + """ + + max_completion_tokens: Optional[int] = None + """Maximum number of completion (output) tokens the model will generate per + request. + + `null` if unconstrained beyond `context_length`. + """ + + object: Optional[str] = None + """Object type. Always `model`.""" + + parameters_str: Optional[str] = None + """Human-readable parameter count, e.g. `1.0T`, `753.9B`, `8B`.""" + + pricing: Optional[Dict[str, str]] = None + """Mapping of token kind to price, as strings to preserve precision. + + Typical keys are `prompt`, `cached_prompt`, and `completion`. When pricing is + available the block also includes `currency` (ISO 4217 code matching the + account's configured billing currency) and `unit` (the denomination the prices + are quoted in, currently always `1M_tokens` for token-priced models). + """ + + recommended_for_assistants: Optional[bool] = None + """ + Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI + Assistant. + """ + + regions: Optional[List[str]] = None + """Public region names where the model is currently deployed (e.g. + + `us-central-1`, `eu-central-1`). + """ + + task: Optional[str] = None + """Primary task the model is intended for, e.g. + + `text-generation`, `audio-text-to-text`, `feature-extraction` (embeddings). + """ class AIRetrieveModelsResponse(BaseModel): - data: List[ModelMetadata] + data: List[Data] object: Optional[str] = None diff --git a/src/telnyx/types/call_conversation_ended.py b/src/telnyx/types/call_conversation_ended.py index a365d3bc..f4b5bd23 100644 --- a/src/telnyx/types/call_conversation_ended.py +++ b/src/telnyx/types/call_conversation_ended.py @@ -45,6 +45,13 @@ class Payload(BaseModel): llm_model: Optional[str] = None """The large language model used during the conversation.""" + reason: Optional[str] = None + """Reason the conversation ended. + + For Conversation Relay, `customer_disconnect` indicates that the customer + WebSocket disconnected. + """ + stt_model: Optional[str] = None """The speech-to-text model used in the conversation.""" diff --git a/src/telnyx/types/calls/__init__.py b/src/telnyx/types/calls/__init__.py index fff6403f..42cb8b84 100644 --- a/src/telnyx/types/calls/__init__.py +++ b/src/telnyx/types/calls/__init__.py @@ -89,8 +89,11 @@ from .action_start_noise_suppression_params import ( ActionStartNoiseSuppressionParams as ActionStartNoiseSuppressionParams, ) -from .transcription_engine_xai_config_param import ( - TranscriptionEngineXaiConfigParam as TranscriptionEngineXaiConfigParam, +from .action_stop_conversation_relay_params import ( + ActionStopConversationRelayParams as ActionStopConversationRelayParams, +) +from .action_start_conversation_relay_params import ( + ActionStartConversationRelayParams as ActionStartConversationRelayParams, ) from .action_stop_noise_suppression_response import ( ActionStopNoiseSuppressionResponse as ActionStopNoiseSuppressionResponse, @@ -104,9 +107,15 @@ from .action_start_noise_suppression_response import ( ActionStartNoiseSuppressionResponse as ActionStartNoiseSuppressionResponse, ) +from .action_stop_conversation_relay_response import ( + ActionStopConversationRelayResponse as ActionStopConversationRelayResponse, +) from .transcription_engine_azure_config_param import ( TranscriptionEngineAzureConfigParam as TranscriptionEngineAzureConfigParam, ) +from .action_start_conversation_relay_response import ( + ActionStartConversationRelayResponse as ActionStartConversationRelayResponse, +) from .transcription_engine_google_config_param import ( TranscriptionEngineGoogleConfigParam as TranscriptionEngineGoogleConfigParam, ) @@ -116,9 +125,6 @@ from .action_add_ai_assistant_messages_response import ( ActionAddAIAssistantMessagesResponse as ActionAddAIAssistantMessagesResponse, ) -from .transcription_engine_assemblyai_config_param import ( - TranscriptionEngineAssemblyaiConfigParam as TranscriptionEngineAssemblyaiConfigParam, -) from .call_control_command_result_with_conversation_id import ( CallControlCommandResultWithConversationID as CallControlCommandResultWithConversationID, ) diff --git a/src/telnyx/types/calls/action_gather_using_ai_params.py b/src/telnyx/types/calls/action_gather_using_ai_params.py index 7441288a..b50c83d5 100644 --- a/src/telnyx/types/calls/action_gather_using_ai_params.py +++ b/src/telnyx/types/calls/action_gather_using_ai_params.py @@ -12,12 +12,11 @@ from .telnyx_voice_settings_param import TelnyxVoiceSettingsParam from .google_transcription_language import GoogleTranscriptionLanguage from .eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam -from ..shared_params.xai_voice_settings import XaiVoiceSettings from ..shared_params.rime_voice_settings import RimeVoiceSettings from ..shared_params.azure_voice_settings import AzureVoiceSettings from ..shared_params.resemble_voice_settings import ResembleVoiceSettings -__all__ = ["ActionGatherUsingAIParams", "MessageHistory", "VoiceSettings"] +__all__ = ["ActionGatherUsingAIParams", "MessageHistory", "VoiceSettings", "VoiceSettingsXaiVoiceSettings"] class ActionGatherUsingAIParams(TypedDict, total=False): @@ -143,6 +142,14 @@ class MessageHistory(TypedDict, total=False): """The role of the message sender""" +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + VoiceSettings: TypeAlias = Union[ ElevenLabsVoiceSettingsParam, TelnyxVoiceSettingsParam, @@ -150,5 +157,5 @@ class MessageHistory(TypedDict, total=False): AzureVoiceSettings, RimeVoiceSettings, ResembleVoiceSettings, - XaiVoiceSettings, + VoiceSettingsXaiVoiceSettings, ] diff --git a/src/telnyx/types/calls/action_gather_using_speak_params.py b/src/telnyx/types/calls/action_gather_using_speak_params.py index 6ea2e9f1..2014077f 100644 --- a/src/telnyx/types/calls/action_gather_using_speak_params.py +++ b/src/telnyx/types/calls/action_gather_using_speak_params.py @@ -8,13 +8,17 @@ from .aws_voice_settings_param import AwsVoiceSettingsParam from .telnyx_voice_settings_param import TelnyxVoiceSettingsParam from .eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam -from ..shared_params.xai_voice_settings import XaiVoiceSettings from ..shared_params.rime_voice_settings import RimeVoiceSettings from ..shared_params.azure_voice_settings import AzureVoiceSettings from ..shared_params.minimax_voice_settings import MinimaxVoiceSettings from ..shared_params.resemble_voice_settings import ResembleVoiceSettings -__all__ = ["ActionGatherUsingSpeakParams", "VoiceSettings", "VoiceSettingsInworldVoiceSettings"] +__all__ = [ + "ActionGatherUsingSpeakParams", + "VoiceSettings", + "VoiceSettingsInworldVoiceSettings", + "VoiceSettingsXaiVoiceSettings", +] class ActionGatherUsingSpeakParams(TypedDict, total=False): @@ -180,6 +184,14 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): """Voice settings provider type""" +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + VoiceSettings: TypeAlias = Union[ ElevenLabsVoiceSettingsParam, TelnyxVoiceSettingsParam, @@ -189,5 +201,5 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): RimeVoiceSettings, ResembleVoiceSettings, VoiceSettingsInworldVoiceSettings, - XaiVoiceSettings, + VoiceSettingsXaiVoiceSettings, ] diff --git a/src/telnyx/types/calls/action_speak_params.py b/src/telnyx/types/calls/action_speak_params.py index d32d50c6..aadd9a68 100644 --- a/src/telnyx/types/calls/action_speak_params.py +++ b/src/telnyx/types/calls/action_speak_params.py @@ -9,13 +9,12 @@ from .aws_voice_settings_param import AwsVoiceSettingsParam from .telnyx_voice_settings_param import TelnyxVoiceSettingsParam from .eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam -from ..shared_params.xai_voice_settings import XaiVoiceSettings from ..shared_params.rime_voice_settings import RimeVoiceSettings from ..shared_params.azure_voice_settings import AzureVoiceSettings from ..shared_params.minimax_voice_settings import MinimaxVoiceSettings from ..shared_params.resemble_voice_settings import ResembleVoiceSettings -__all__ = ["ActionSpeakParams", "VoiceSettings", "VoiceSettingsInworldVoiceSettings"] +__all__ = ["ActionSpeakParams", "VoiceSettings", "VoiceSettingsInworldVoiceSettings", "VoiceSettingsXaiVoiceSettings"] class ActionSpeakParams(TypedDict, total=False): @@ -158,6 +157,14 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): """Voice settings provider type""" +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + VoiceSettings: TypeAlias = Union[ ElevenLabsVoiceSettingsParam, TelnyxVoiceSettingsParam, @@ -167,5 +174,5 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): RimeVoiceSettings, ResembleVoiceSettings, VoiceSettingsInworldVoiceSettings, - XaiVoiceSettings, + VoiceSettingsXaiVoiceSettings, ] diff --git a/src/telnyx/types/calls/action_start_ai_assistant_params.py b/src/telnyx/types/calls/action_start_ai_assistant_params.py index 87a41a79..b00900db 100644 --- a/src/telnyx/types/calls/action_start_ai_assistant_params.py +++ b/src/telnyx/types/calls/action_start_ai_assistant_params.py @@ -11,7 +11,6 @@ from .telnyx_voice_settings_param import TelnyxVoiceSettingsParam from ..call_assistant_request_param import CallAssistantRequestParam from .eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam -from ..shared_params.xai_voice_settings import XaiVoiceSettings from ..shared_params.rime_voice_settings import RimeVoiceSettings from ..shared_params.azure_voice_settings import AzureVoiceSettings from ..shared_params.resemble_voice_settings import ResembleVoiceSettings @@ -28,6 +27,7 @@ "MessageHistoryDeveloperMessage", "Participant", "VoiceSettings", + "VoiceSettingsXaiVoiceSettings", ] @@ -235,6 +235,14 @@ class Participant(TypedDict, total=False): """Determines what happens to the conversation when this participant hangs up.""" +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + VoiceSettings: TypeAlias = Union[ ElevenLabsVoiceSettingsParam, TelnyxVoiceSettingsParam, @@ -242,5 +250,5 @@ class Participant(TypedDict, total=False): AzureVoiceSettings, RimeVoiceSettings, ResembleVoiceSettings, - XaiVoiceSettings, + VoiceSettingsXaiVoiceSettings, ] diff --git a/src/telnyx/types/calls/action_start_conversation_relay_params.py b/src/telnyx/types/calls/action_start_conversation_relay_params.py new file mode 100644 index 00000000..c68b5934 --- /dev/null +++ b/src/telnyx/types/calls/action_start_conversation_relay_params.py @@ -0,0 +1,236 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .aws_voice_settings_param import AwsVoiceSettingsParam +from .telnyx_voice_settings_param import TelnyxVoiceSettingsParam +from .eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam +from ..shared_params.rime_voice_settings import RimeVoiceSettings +from ..shared_params.azure_voice_settings import AzureVoiceSettings +from ..shared_params.resemble_voice_settings import ResembleVoiceSettings + +__all__ = [ + "ActionStartConversationRelayParams", + "Assistant", + "InterruptionSettings", + "Language", + "Participant", + "Transcription", + "VoiceSettings", + "VoiceSettingsXaiVoiceSettings", +] + + +class ActionStartConversationRelayParams(TypedDict, total=False): + conversation_relay_url: Required[str] + """WebSocket URL for your Conversation Relay server. + + Must start with `ws://` or `wss://`. + """ + + assistant: Assistant + """Custom parameters for the Conversation Relay session. + + Pass key-value data as `assistant.dynamic_variables` to make it available to the + relay session. + """ + + client_state: str + """Use this field to add state to subsequent webhooks. + + It must be a valid Base-64 encoded string. + """ + + command_id: str + """Use this field to avoid duplicate commands. + + Telnyx will ignore any command with the same `command_id` for the same + `call_control_id`. + """ + + conversation_relay_dtmf_detection: bool + """Enable DTMF detection for the relay session.""" + + greeting: str + """Text played when the relay session starts.""" + + interruption_settings: InterruptionSettings + """Settings for handling caller interruptions during Conversation Relay speech.""" + + language: str + """Default language for the relay session. + + This value is used for both text-to-speech and speech recognition unless + `tts_language` or `transcription_language` are provided. + """ + + languages: Iterable[Language] + """Language-specific TTS and transcription settings. + + Use this when the relay session needs per-language provider, voice, or speech + model configuration. + """ + + participants: Iterable[Participant] + """Participants to add to the conversation.""" + + send_message_history_updates: bool + """When true, sends message history update webhooks.""" + + transcription: Transcription + """Speech-to-text settings for Conversation Relay.""" + + transcription_language: str + """Language to use for speech recognition. + + Overrides `language` for transcription when provided. + """ + + tts_language: str + """Language to use for text-to-speech. Overrides `language` for TTS when provided.""" + + user_response_timeout_ms: int + """Time in milliseconds to wait for caller input before timing out.""" + + voice: str + """The voice to be used by the voice assistant. + + Currently we support ElevenLabs, Telnyx and AWS voices. + + **Supported Providers:** + + - **AWS:** Use `AWS.Polly.` (e.g., `AWS.Polly.Joanna`). For neural + voices, which provide more realistic, human-like speech, append `-Neural` to + the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the + [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html) + for compatibility. + - **Azure:** Use `Azure.. (e.g. Azure.en-CA-ClaraNeural, + Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural, + Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to + [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).) + - **ElevenLabs:** Use `ElevenLabs..` (e.g., + `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use + ElevenLabs, you must provide your ElevenLabs API key as an integration secret + under `"voice_settings": {"api_key_ref": ""}`. See + [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret) + for details. Check + [available voices](https://elevenlabs.io/docs/api-reference/get-voices). + - **Telnyx:** Use `Telnyx..` + - **Inworld:** Use `Inworld..` (e.g., `Inworld.Mini.Loretta`, + `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`. + - **xAI:** Use `xAI.` (e.g., `xAI.eve`). Available voices: `eve`, + `ara`, `rex`, `sal`, `leo`. + """ + + voice_settings: VoiceSettings + """The settings associated with the voice selected""" + + +class Assistant(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] + """Custom parameters for the Conversation Relay session. + + Pass key-value data as `assistant.dynamic_variables` to make it available to the relay session. + """ + + dynamic_variables: Dict[str, str] + """Custom key-value parameters forwarded to the Conversation Relay session.""" + + +class InterruptionSettings(TypedDict, total=False): + """Settings for handling caller interruptions during Conversation Relay speech.""" + + enable: bool + """Legacy boolean form. + + `true` is equivalent to `interruptible=any`; `false` is equivalent to + `interruptible=none`. + """ + + interruptible: Literal["none", "any", "speech", "dtmf"] + """Controls when caller input can interrupt assistant speech. + + `any` allows speech or DTMF interruptions; `none` disables interruptions; + `speech` allows speech only; `dtmf` allows DTMF only. + """ + + interruptible_greeting: Literal["none", "any", "speech", "dtmf"] + """Controls when caller input can interrupt assistant speech. + + `any` allows speech or DTMF interruptions; `none` disables interruptions; + `speech` allows speech only; `dtmf` allows DTMF only. + """ + + welcome_greeting_interruptible: Literal["none", "any", "speech", "dtmf"] + """Controls when caller input can interrupt assistant speech. + + `any` allows speech or DTMF interruptions; `none` disables interruptions; + `speech` allows speech only; `dtmf` allows DTMF only. + """ + + +class Language(TypedDict, total=False): + """Language-specific speech and transcription settings for Conversation Relay.""" + + code: str + """BCP 47 language code.""" + + speech_model: str + """Speech recognition model for this language.""" + + transcription_provider: str + """Speech-to-text provider for this language.""" + + tts_provider: str + """Text-to-speech provider for this language.""" + + voice: str + """Voice identifier for this language.""" + + +class Participant(TypedDict, total=False): + id: Required[str] + """The call_control_id of the participant to add to the conversation.""" + + role: Required[Literal["user"]] + """The role of the participant in the conversation.""" + + name: str + """Display name for the participant.""" + + on_hangup: Literal["continue_conversation", "end_conversation"] + """Determines what happens to the conversation when this participant hangs up.""" + + +class Transcription(TypedDict, total=False): + """Speech-to-text settings for Conversation Relay.""" + + language: str + """Transcription language.""" + + model: str + """Transcription model to use.""" + + provider: str + """Transcription provider to use.""" + + +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + +VoiceSettings: TypeAlias = Union[ + ElevenLabsVoiceSettingsParam, + TelnyxVoiceSettingsParam, + AwsVoiceSettingsParam, + AzureVoiceSettings, + RimeVoiceSettings, + ResembleVoiceSettings, + VoiceSettingsXaiVoiceSettings, +] diff --git a/src/telnyx/types/calls/action_start_conversation_relay_response.py b/src/telnyx/types/calls/action_start_conversation_relay_response.py new file mode 100644 index 00000000..4329aac3 --- /dev/null +++ b/src/telnyx/types/calls/action_start_conversation_relay_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ActionStartConversationRelayResponse", "Data"] + + +class Data(BaseModel): + conversation_relay_id: Optional[str] = None + """The ID of the Conversation Relay session created by the command.""" + + result: Optional[str] = None + + +class ActionStartConversationRelayResponse(BaseModel): + data: Optional[Data] = None diff --git a/src/telnyx/types/calls/action_start_transcription_params.py b/src/telnyx/types/calls/action_start_transcription_params.py index 316a8f26..5e800179 100644 --- a/src/telnyx/types/calls/action_start_transcription_params.py +++ b/src/telnyx/types/calls/action_start_transcription_params.py @@ -9,13 +9,16 @@ from .deepgram_nova3_config_param import DeepgramNova3ConfigParam from .transcription_engine_a_config_param import TranscriptionEngineAConfigParam from .transcription_engine_b_config_param import TranscriptionEngineBConfigParam -from .transcription_engine_xai_config_param import TranscriptionEngineXaiConfigParam from .transcription_engine_azure_config_param import TranscriptionEngineAzureConfigParam from .transcription_engine_google_config_param import TranscriptionEngineGoogleConfigParam from .transcription_engine_telnyx_config_param import TranscriptionEngineTelnyxConfigParam -from .transcription_engine_assemblyai_config_param import TranscriptionEngineAssemblyaiConfigParam -__all__ = ["ActionStartTranscriptionParams", "TranscriptionEngineConfig"] +__all__ = [ + "ActionStartTranscriptionParams", + "TranscriptionEngineConfig", + "TranscriptionEngineConfigTranscriptionEngineXaiConfig", + "TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig", +] class ActionStartTranscriptionParams(TypedDict, total=False): @@ -49,12 +52,69 @@ class ActionStartTranscriptionParams(TypedDict, total=False): """ +class TranscriptionEngineConfigTranscriptionEngineXaiConfig(TypedDict, total=False): + interim_results: bool + """Whether to send also interim results. + + If set to false, only final results will be sent. + """ + + language: Literal[ + "ar", + "cs", + "da", + "de", + "en", + "es", + "fa", + "fil", + "fr", + "hi", + "id", + "it", + "ja", + "ko", + "mk", + "ms", + "nl", + "pl", + "pt", + "ro", + "ru", + "sv", + "th", + "tr", + "vi", + ] + """Language to use for speech recognition""" + + transcription_engine: Literal["xAI"] + """Engine identifier for xAI transcription service""" + + transcription_model: Literal["xai/grok-stt"] + """The model to use for transcription.""" + + +class TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig(TypedDict, total=False): + interim_results: bool + """Whether to send also interim results. + + If set to false, only final results will be sent. + """ + + transcription_engine: Literal["AssemblyAI"] + """Engine identifier for AssemblyAI transcription service""" + + transcription_model: Literal["assemblyai/universal-streaming"] + """The model to use for transcription.""" + + TranscriptionEngineConfig: TypeAlias = Union[ TranscriptionEngineGoogleConfigParam, TranscriptionEngineTelnyxConfigParam, TranscriptionEngineAzureConfigParam, - TranscriptionEngineXaiConfigParam, - TranscriptionEngineAssemblyaiConfigParam, + TranscriptionEngineConfigTranscriptionEngineXaiConfig, + TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig, TranscriptionEngineAConfigParam, TranscriptionEngineBConfigParam, DeepgramNova2ConfigParam, diff --git a/src/telnyx/types/calls/action_stop_conversation_relay_params.py b/src/telnyx/types/calls/action_stop_conversation_relay_params.py new file mode 100644 index 00000000..a8cbd7df --- /dev/null +++ b/src/telnyx/types/calls/action_stop_conversation_relay_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ActionStopConversationRelayParams"] + + +class ActionStopConversationRelayParams(TypedDict, total=False): + client_state: str + """Use this field to add state to subsequent webhooks. + + It must be a valid Base-64 encoded string. + """ + + command_id: str + """Use this field to avoid duplicate commands. + + Telnyx will ignore any command with the same `command_id` for the same + `call_control_id`. + """ diff --git a/src/telnyx/types/calls/action_stop_conversation_relay_response.py b/src/telnyx/types/calls/action_stop_conversation_relay_response.py new file mode 100644 index 00000000..e30ec8d2 --- /dev/null +++ b/src/telnyx/types/calls/action_stop_conversation_relay_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .call_control_command_result import CallControlCommandResult + +__all__ = ["ActionStopConversationRelayResponse"] + + +class ActionStopConversationRelayResponse(BaseModel): + data: Optional[CallControlCommandResult] = None diff --git a/src/telnyx/types/calls/transcription_engine_assemblyai_config_param.py b/src/telnyx/types/calls/transcription_engine_assemblyai_config_param.py deleted file mode 100644 index b5f62f19..00000000 --- a/src/telnyx/types/calls/transcription_engine_assemblyai_config_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["TranscriptionEngineAssemblyaiConfigParam"] - - -class TranscriptionEngineAssemblyaiConfigParam(TypedDict, total=False): - interim_results: bool - """Whether to send also interim results. - - If set to false, only final results will be sent. - """ - - transcription_engine: Literal["AssemblyAI"] - """Engine identifier for AssemblyAI transcription service""" - - transcription_model: Literal["assemblyai/universal-streaming"] - """The model to use for transcription.""" diff --git a/src/telnyx/types/calls/transcription_engine_xai_config_param.py b/src/telnyx/types/calls/transcription_engine_xai_config_param.py deleted file mode 100644 index 66256ff0..00000000 --- a/src/telnyx/types/calls/transcription_engine_xai_config_param.py +++ /dev/null @@ -1,50 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["TranscriptionEngineXaiConfigParam"] - - -class TranscriptionEngineXaiConfigParam(TypedDict, total=False): - interim_results: bool - """Whether to send also interim results. - - If set to false, only final results will be sent. - """ - - language: Literal[ - "ar", - "cs", - "da", - "de", - "en", - "es", - "fa", - "fil", - "fr", - "hi", - "id", - "it", - "ja", - "ko", - "mk", - "ms", - "nl", - "pl", - "pt", - "ro", - "ru", - "sv", - "th", - "tr", - "vi", - ] - """Language to use for speech recognition""" - - transcription_engine: Literal["xAI"] - """Engine identifier for xAI transcription service""" - - transcription_model: Literal["xai/grok-stt"] - """The model to use for transcription.""" diff --git a/src/telnyx/types/calls/transcription_start_request_param.py b/src/telnyx/types/calls/transcription_start_request_param.py index 8848b51c..090b50d7 100644 --- a/src/telnyx/types/calls/transcription_start_request_param.py +++ b/src/telnyx/types/calls/transcription_start_request_param.py @@ -9,20 +9,81 @@ from .deepgram_nova3_config_param import DeepgramNova3ConfigParam from .transcription_engine_a_config_param import TranscriptionEngineAConfigParam from .transcription_engine_b_config_param import TranscriptionEngineBConfigParam -from .transcription_engine_xai_config_param import TranscriptionEngineXaiConfigParam from .transcription_engine_azure_config_param import TranscriptionEngineAzureConfigParam from .transcription_engine_google_config_param import TranscriptionEngineGoogleConfigParam from .transcription_engine_telnyx_config_param import TranscriptionEngineTelnyxConfigParam -from .transcription_engine_assemblyai_config_param import TranscriptionEngineAssemblyaiConfigParam -__all__ = ["TranscriptionStartRequestParam", "TranscriptionEngineConfig"] +__all__ = [ + "TranscriptionStartRequestParam", + "TranscriptionEngineConfig", + "TranscriptionEngineConfigTranscriptionEngineXaiConfig", + "TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig", +] + + +class TranscriptionEngineConfigTranscriptionEngineXaiConfig(TypedDict, total=False): + interim_results: bool + """Whether to send also interim results. + + If set to false, only final results will be sent. + """ + + language: Literal[ + "ar", + "cs", + "da", + "de", + "en", + "es", + "fa", + "fil", + "fr", + "hi", + "id", + "it", + "ja", + "ko", + "mk", + "ms", + "nl", + "pl", + "pt", + "ro", + "ru", + "sv", + "th", + "tr", + "vi", + ] + """Language to use for speech recognition""" + + transcription_engine: Literal["xAI"] + """Engine identifier for xAI transcription service""" + + transcription_model: Literal["xai/grok-stt"] + """The model to use for transcription.""" + + +class TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig(TypedDict, total=False): + interim_results: bool + """Whether to send also interim results. + + If set to false, only final results will be sent. + """ + + transcription_engine: Literal["AssemblyAI"] + """Engine identifier for AssemblyAI transcription service""" + + transcription_model: Literal["assemblyai/universal-streaming"] + """The model to use for transcription.""" + TranscriptionEngineConfig: TypeAlias = Union[ TranscriptionEngineGoogleConfigParam, TranscriptionEngineTelnyxConfigParam, TranscriptionEngineAzureConfigParam, - TranscriptionEngineXaiConfigParam, - TranscriptionEngineAssemblyaiConfigParam, + TranscriptionEngineConfigTranscriptionEngineXaiConfig, + TranscriptionEngineConfigTranscriptionEngineAssemblyaiConfig, TranscriptionEngineAConfigParam, TranscriptionEngineBConfigParam, DeepgramNova2ConfigParam, diff --git a/src/telnyx/types/conferences/action_speak_params.py b/src/telnyx/types/conferences/action_speak_params.py index 7a498924..6a8fb926 100644 --- a/src/telnyx/types/conferences/action_speak_params.py +++ b/src/telnyx/types/conferences/action_speak_params.py @@ -7,7 +7,6 @@ from ..._types import SequenceNotStr from ..calls.aws_voice_settings_param import AwsVoiceSettingsParam -from ..shared_params.xai_voice_settings import XaiVoiceSettings from ..calls.telnyx_voice_settings_param import TelnyxVoiceSettingsParam from ..shared_params.rime_voice_settings import RimeVoiceSettings from ..shared_params.azure_voice_settings import AzureVoiceSettings @@ -15,7 +14,7 @@ from ..shared_params.resemble_voice_settings import ResembleVoiceSettings from ..calls.eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam -__all__ = ["ActionSpeakParams", "VoiceSettings", "VoiceSettingsInworldVoiceSettings"] +__all__ = ["ActionSpeakParams", "VoiceSettings", "VoiceSettingsInworldVoiceSettings", "VoiceSettingsXaiVoiceSettings"] class ActionSpeakParams(TypedDict, total=False): @@ -140,6 +139,14 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): """Voice settings provider type""" +class VoiceSettingsXaiVoiceSettings(TypedDict, total=False): + type: Required[Literal["xai"]] + """Voice settings provider type""" + + language: str + """Language code, or `auto` to detect automatically.""" + + VoiceSettings: TypeAlias = Union[ ElevenLabsVoiceSettingsParam, TelnyxVoiceSettingsParam, @@ -149,5 +156,5 @@ class VoiceSettingsInworldVoiceSettings(TypedDict, total=False): RimeVoiceSettings, ResembleVoiceSettings, VoiceSettingsInworldVoiceSettings, - XaiVoiceSettings, + VoiceSettingsXaiVoiceSettings, ] diff --git a/src/telnyx/types/model_metadata.py b/src/telnyx/types/model_metadata.py deleted file mode 100644 index 465f1372..00000000 --- a/src/telnyx/types/model_metadata.py +++ /dev/null @@ -1,124 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ModelMetadata"] - - -class ModelMetadata(BaseModel): - """Metadata for a model available on Telnyx Inference. - - Returned by `GET /v2/ai/openai/models` (and the deprecated `GET /v2/ai/models`). Open-source models live under their Hugging Face organization (e.g. `moonshotai/Kimi-K2.6`, `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`); fine-tuned models are owned by the Telnyx organization that trained them. - """ - - id: str - """Model identifier. - - For open-source models, follows the `{organization}/{model_name}` convention - from Hugging Face (e.g. `moonshotai/Kimi-K2.6`). - """ - - context_length: int - """ - Maximum total tokens (prompt + completion) supported by the model in a single - request. - """ - - created: datetime - """Timestamp at which the model was registered on Telnyx Inference (ISO 8601).""" - - languages: List[str] - """ISO language codes the model supports (e.g. `en`, `es`).""" - - license: str - """License the model is distributed under, e.g. - - `Apache 2.0`, `MIT`, `Llama 3 Community License`. - """ - - organization: str - """ - Organization that originally published the model, matching the prefix of `id` - for open-source models. - """ - - owned_by: str - """Owner of the model. - - `Telnyx` for Telnyx-hosted open-source models, the upstream provider name for - proxied models, or the Telnyx organization id for fine-tuned models. - """ - - parameters: int - """Total parameter count of the model.""" - - tier: Literal["small", "medium", "large", "unlisted"] - """Billing tier the model belongs to. - - Used together with `pricing` to determine cost per 1M tokens. - """ - - base_model: Optional[str] = None - """Base model the fine-tuned model was trained from. - - Only set for fine-tuned models. - """ - - description: Optional[str] = None - """Short, human-readable summary of what the model is best suited for.""" - - is_fine_tunable: Optional[bool] = None - """ - Whether the model can be used as a base for a fine-tuning job via - `POST /v2/ai/fine_tuning/jobs`. - """ - - is_vision_supported: Optional[bool] = None - """ - Whether the model accepts image inputs in chat completions (multimodal vision - support). - """ - - max_completion_tokens: Optional[int] = None - """Maximum number of completion (output) tokens the model will generate per - request. - - `null` if unconstrained beyond `context_length`. - """ - - object: Optional[str] = None - """Object type. Always `model`.""" - - parameters_str: Optional[str] = None - """Human-readable parameter count, e.g. `1.0T`, `753.9B`, `8B`.""" - - pricing: Optional[Dict[str, str]] = None - """Mapping of token kind to price, as strings to preserve precision. - - Typical keys are `prompt`, `cached_prompt`, and `completion`. When pricing is - available the block also includes `currency` (ISO 4217 code matching the - account's configured billing currency) and `unit` (the denomination the prices - are quoted in, currently always `1M_tokens` for token-priced models). - """ - - recommended_for_assistants: Optional[bool] = None - """ - Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI - Assistant. - """ - - regions: Optional[List[str]] = None - """Public region names where the model is currently deployed (e.g. - - `us-central-1`, `eu-central-1`). - """ - - task: Optional[str] = None - """Primary task the model is intended for, e.g. - - `text-generation`, `audio-text-to-text`, `feature-extraction` (embeddings). - """ diff --git a/src/telnyx/types/network_interface.py b/src/telnyx/types/network_interface.py new file mode 100644 index 00000000..f133b69d --- /dev/null +++ b/src/telnyx/types/network_interface.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .interface_status import InterfaceStatus + +__all__ = ["NetworkInterface"] + + +class NetworkInterface(BaseModel): + name: Optional[str] = None + """A user specified name for the interface.""" + + network_id: Optional[str] = None + """The id of the network associated with the interface.""" + + status: Optional[InterfaceStatus] = None + """The current status of the interface deployment.""" diff --git a/src/telnyx/types/network_list_interfaces_response.py b/src/telnyx/types/network_list_interfaces_response.py index ebf8ccec..e045dd1f 100644 --- a/src/telnyx/types/network_list_interfaces_response.py +++ b/src/telnyx/types/network_list_interfaces_response.py @@ -2,13 +2,14 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .interface_status import InterfaceStatus +from .network_interface import NetworkInterface -__all__ = ["NetworkListInterfacesResponse", "Region"] +__all__ = ["NetworkListInterfacesResponse", "NetworkListInterfacesResponseRegion"] -class Region(BaseModel): +class NetworkListInterfacesResponseRegion(BaseModel): code: Optional[str] = None """Region code of the interface.""" @@ -19,32 +20,14 @@ class Region(BaseModel): """Identifies the type of the resource.""" -class NetworkListInterfacesResponse(BaseModel): - id: Optional[str] = None - """Identifies the resource.""" - - created_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was created.""" - - name: Optional[str] = None - """A user specified name for the interface.""" - - network_id: Optional[str] = None - """The id of the network associated with the interface.""" - - record_type: Optional[str] = None +class NetworkListInterfacesResponse(Record, NetworkInterface): + record_type: Optional[str] = None # type: ignore """Identifies the type of the resource.""" - region: Optional[Region] = None + region: Optional[NetworkListInterfacesResponseRegion] = None region_code: Optional[str] = None """The region interface is deployed to.""" - status: Optional[InterfaceStatus] = None - """The current status of the interface deployment.""" - type: Optional[str] = None """Identifies the type of the interface.""" - - updated_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was updated.""" diff --git a/src/telnyx/types/public_internet_gateway_create_response.py b/src/telnyx/types/public_internet_gateway_create_response.py index 76e78efa..11e16259 100644 --- a/src/telnyx/types/public_internet_gateway_create_response.py +++ b/src/telnyx/types/public_internet_gateway_create_response.py @@ -2,11 +2,20 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .public_internet_gateway_read import PublicInternetGatewayRead +from .network_interface import NetworkInterface -__all__ = ["PublicInternetGatewayCreateResponse"] +__all__ = ["PublicInternetGatewayCreateResponse", "Data"] + + +class Data(Record, NetworkInterface): + public_ip: Optional[str] = None + """The publically accessible ip for this interface.""" + + region_code: Optional[str] = None + """The region interface is deployed to.""" class PublicInternetGatewayCreateResponse(BaseModel): - data: Optional[PublicInternetGatewayRead] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/public_internet_gateway_delete_response.py b/src/telnyx/types/public_internet_gateway_delete_response.py index 1935227e..8bc2e312 100644 --- a/src/telnyx/types/public_internet_gateway_delete_response.py +++ b/src/telnyx/types/public_internet_gateway_delete_response.py @@ -2,11 +2,20 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .public_internet_gateway_read import PublicInternetGatewayRead +from .network_interface import NetworkInterface -__all__ = ["PublicInternetGatewayDeleteResponse"] +__all__ = ["PublicInternetGatewayDeleteResponse", "Data"] + + +class Data(Record, NetworkInterface): + public_ip: Optional[str] = None + """The publically accessible ip for this interface.""" + + region_code: Optional[str] = None + """The region interface is deployed to.""" class PublicInternetGatewayDeleteResponse(BaseModel): - data: Optional[PublicInternetGatewayRead] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/public_internet_gateway_list_response.py b/src/telnyx/types/public_internet_gateway_list_response.py new file mode 100644 index 00000000..ac8fa8a6 --- /dev/null +++ b/src/telnyx/types/public_internet_gateway_list_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .record import Record +from .network_interface import NetworkInterface + +__all__ = ["PublicInternetGatewayListResponse"] + + +class PublicInternetGatewayListResponse(Record, NetworkInterface): + public_ip: Optional[str] = None + """The publically accessible ip for this interface.""" + + region_code: Optional[str] = None + """The region interface is deployed to.""" diff --git a/src/telnyx/types/public_internet_gateway_read.py b/src/telnyx/types/public_internet_gateway_read.py deleted file mode 100644 index 88d1785f..00000000 --- a/src/telnyx/types/public_internet_gateway_read.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel -from .interface_status import InterfaceStatus - -__all__ = ["PublicInternetGatewayRead"] - - -class PublicInternetGatewayRead(BaseModel): - id: Optional[str] = None - """Identifies the resource.""" - - created_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was created.""" - - name: Optional[str] = None - """A user specified name for the interface.""" - - network_id: Optional[str] = None - """The id of the network associated with the interface.""" - - public_ip: Optional[str] = None - """The publically accessible ip for this interface.""" - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - region_code: Optional[str] = None - """The region interface is deployed to.""" - - status: Optional[InterfaceStatus] = None - """The current status of the interface deployment.""" - - updated_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was updated.""" diff --git a/src/telnyx/types/public_internet_gateway_retrieve_response.py b/src/telnyx/types/public_internet_gateway_retrieve_response.py index 5c95dcce..c1b162e1 100644 --- a/src/telnyx/types/public_internet_gateway_retrieve_response.py +++ b/src/telnyx/types/public_internet_gateway_retrieve_response.py @@ -2,11 +2,20 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .public_internet_gateway_read import PublicInternetGatewayRead +from .network_interface import NetworkInterface -__all__ = ["PublicInternetGatewayRetrieveResponse"] +__all__ = ["PublicInternetGatewayRetrieveResponse", "Data"] + + +class Data(Record, NetworkInterface): + public_ip: Optional[str] = None + """The publically accessible ip for this interface.""" + + region_code: Optional[str] = None + """The region interface is deployed to.""" class PublicInternetGatewayRetrieveResponse(BaseModel): - data: Optional[PublicInternetGatewayRead] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/shared/__init__.py b/src/telnyx/types/shared/__init__.py index 5c06c0cc..ed3d17e7 100644 --- a/src/telnyx/types/shared/__init__.py +++ b/src/telnyx/types/shared/__init__.py @@ -14,7 +14,6 @@ from .netapps_location import NetappsLocation as NetappsLocation from .room_participant import RoomParticipant as RoomParticipant from .region_information import RegionInformation as RegionInformation -from .xai_voice_settings import XaiVoiceSettings as XaiVoiceSettings from .rime_voice_settings import RimeVoiceSettings as RimeVoiceSettings from .azure_voice_settings import AzureVoiceSettings as AzureVoiceSettings from .porting_order_status import PortingOrderStatus as PortingOrderStatus diff --git a/src/telnyx/types/shared/xai_voice_settings.py b/src/telnyx/types/shared/xai_voice_settings.py deleted file mode 100644 index 3ad6ade7..00000000 --- a/src/telnyx/types/shared/xai_voice_settings.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["XaiVoiceSettings"] - - -class XaiVoiceSettings(BaseModel): - type: Literal["xai"] - """Voice settings provider type""" - - language: Optional[str] = None - """Language code, or `auto` to detect automatically.""" diff --git a/src/telnyx/types/shared_params/__init__.py b/src/telnyx/types/shared_params/__init__.py index 277b4842..1143dd3d 100644 --- a/src/telnyx/types/shared_params/__init__.py +++ b/src/telnyx/types/shared_params/__init__.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .sim_card_status import SimCardStatus as SimCardStatus -from .xai_voice_settings import XaiVoiceSettings as XaiVoiceSettings from .rime_voice_settings import RimeVoiceSettings as RimeVoiceSettings from .azure_voice_settings import AzureVoiceSettings as AzureVoiceSettings from .book_appointment_tool import BookAppointmentTool as BookAppointmentTool diff --git a/src/telnyx/types/shared_params/xai_voice_settings.py b/src/telnyx/types/shared_params/xai_voice_settings.py deleted file mode 100644 index 522c82e7..00000000 --- a/src/telnyx/types/shared_params/xai_voice_settings.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["XaiVoiceSettings"] - - -class XaiVoiceSettings(TypedDict, total=False): - type: Required[Literal["xai"]] - """Voice settings provider type""" - - language: str - """Language code, or `auto` to detect automatically.""" diff --git a/src/telnyx/types/uac_connection.py b/src/telnyx/types/uac_connection.py deleted file mode 100644 index 65a32656..00000000 --- a/src/telnyx/types/uac_connection.py +++ /dev/null @@ -1,196 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .fqdn import Fqdn -from .._models import BaseModel -from .dtmf_type import DtmfType -from .uac_inbound import UacInbound -from .uac_outbound import UacOutbound -from .encrypted_media import EncryptedMedia -from .anchorsite_override import AnchorsiteOverride -from .uac_external_settings import UacExternalSettings -from .uac_internal_settings import UacInternalSettings -from .connection_rtcp_settings import ConnectionRtcpSettings -from .shared.connection_jitter_buffer import ConnectionJitterBuffer -from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails - -__all__ = ["UacConnection"] - - -class UacConnection(BaseModel): - """ - A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. - """ - - id: Optional[str] = None - """Identifies the type of resource.""" - - active: Optional[bool] = None - """Defaults to true""" - - anchorsite_override: Optional[AnchorsiteOverride] = None - """ - `Latency` directs Telnyx to route media through the site with the lowest - round-trip time to the user's connection. Telnyx calculates this time using ICMP - ping messages. This can be disabled by specifying a site to handle all media. - """ - - android_push_credential_id: Optional[str] = None - """The uuid of the push credential for Android""" - - authentication: Optional[Literal["uac-authentication"]] = None - """The authentication strategy used by this connection.""" - - call_cost_in_webhooks: Optional[bool] = None - """Specifies if call cost webhooks should be sent for this connection.""" - - connection_name: Optional[str] = None - - created_at: Optional[str] = None - """ISO-8601 formatted date indicating when the resource was created.""" - - default_on_hold_comfort_noise_enabled: Optional[bool] = None - """When enabled, Telnyx will generate comfort noise when you place the call on - hold. - - If disabled, you will need to generate comfort noise or on hold music to avoid - RTP timeout. - """ - - dtmf_type: Optional[DtmfType] = None - """Sets the type of DTMF digits sent from Telnyx to this Connection. - - Note that DTMF digits sent to Telnyx will be accepted in all formats. - """ - - encode_contact_header_enabled: Optional[bool] = None - """ - Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG - scenarios. - """ - - encrypted_media: Optional[EncryptedMedia] = None - """Enable use of SRTP for encryption. - - Cannot be set if the transport_portocol is TLS. - """ - - external_uac_settings: Optional[UacExternalSettings] = None - """ - External SIP peer settings used by Telnyx when registering to your PBX and - routing outbound calls. - """ - - fqdn: Optional[str] = None - """The Telnyx-managed FQDN generated for the UAC connection.""" - - fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None - """The fixed outbound authentication mode used by UAC FQDN records.""" - - fqdns: Optional[List[Fqdn]] = None - """FQDN records managed automatically by the UAC connection lifecycle.""" - - inbound: Optional[UacInbound] = None - - internal_uac_settings: Optional[UacInternalSettings] = None - """Internal Telnyx-side settings for a UAC connection.""" - - ios_push_credential_id: Optional[str] = None - """The uuid of the push credential for Ios""" - - jitter_buffer: Optional[ConnectionJitterBuffer] = None - """Configuration options for Jitter Buffer. - - Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off - unless enabled. You may define min and max values in msec for customized - buffering behaviors. Larger values add latency but tolerate more jitter, while - smaller values reduce latency but are more sensitive to jitter and reordering. - """ - - noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None - """Controls when noise suppression is applied to calls. - - When set to 'inbound', noise suppression is applied to incoming audio. When set - to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied - in both directions. When set to 'disabled', noise suppression is turned off. - """ - - noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None - """Configuration options for noise suppression. - - These settings are stored regardless of the noise_suppression value, but only - take effect when noise_suppression is not 'disabled'. If you disable noise - suppression and later re-enable it, the previously configured settings will be - used. - """ - - onnet_t38_passthrough_enabled: Optional[bool] = None - """ - Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly - if both are on the Telnyx network. If this is disabled, Telnyx will be able to - use T38 on just one leg of the call depending on each leg's settings. - """ - - outbound: Optional[UacOutbound] = None - - password: Optional[str] = None - """The password to be used as part of the credentials. - - Must be 8 to 128 characters long. - """ - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - registration_status: Optional[str] = None - """The most recently known SIP registration status for this UAC connection.""" - - registration_status_updated_at: Optional[str] = None - """ - ISO 8601 formatted date indicating when the registration status was last - updated. - """ - - rtcp_settings: Optional[ConnectionRtcpSettings] = None - - sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None - """This feature enables inbound SIP URI calls to your Credential Auth Connection. - - If enabled for all (unrestricted) then anyone who calls the SIP URI - @telnyx.com will be connected to your Connection. You can also - choose to allow only calls that are originated on any Connections under your - account (internal). - """ - - tags: Optional[List[str]] = None - """Tags associated with the connection.""" - - updated_at: Optional[str] = None - """ISO-8601 formatted date indicating when the resource was updated.""" - - user_name: Optional[str] = None - """The user name to be used as part of the credentials. - - Must be 4-32 characters long and alphanumeric values only (no spaces or special - characters). At least one of the first 5 characters must be a letter. - """ - - webhook_api_version: Optional[Literal["1", "2"]] = None - """Determines which webhook format will be used, Telnyx API v1 or v2.""" - - webhook_event_failover_url: Optional[str] = None - """ - The failover URL where webhooks related to this connection will be sent if - sending to the primary URL fails. Must include a scheme, such as 'https'. - """ - - webhook_event_url: Optional[str] = None - """The URL where webhooks related to this connection will be sent. - - Must include a scheme, such as 'https'. - """ - - webhook_timeout_secs: Optional[int] = None - """Specifies how many seconds to wait before timing out a webhook.""" diff --git a/src/telnyx/types/uac_connection_create_params.py b/src/telnyx/types/uac_connection_create_params.py index 60b9ee3d..527ec344 100644 --- a/src/telnyx/types/uac_connection_create_params.py +++ b/src/telnyx/types/uac_connection_create_params.py @@ -8,15 +8,12 @@ from .._types import SequenceNotStr from .dtmf_type import DtmfType from .encrypted_media import EncryptedMedia -from .uac_outbound_param import UacOutboundParam from .anchorsite_override import AnchorsiteOverride -from .uac_external_settings_param import UacExternalSettingsParam -from .uac_internal_settings_param import UacInternalSettingsParam from .connection_rtcp_settings_param import ConnectionRtcpSettingsParam from .shared_params.connection_jitter_buffer import ConnectionJitterBuffer from .shared_params.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionCreateParams", "Inbound"] +__all__ = ["UacConnectionCreateParams", "ExternalUacSettings", "Inbound", "InternalUacSettings", "Outbound"] class UacConnectionCreateParams(TypedDict, total=False): @@ -65,7 +62,7 @@ class UacConnectionCreateParams(TypedDict, total=False): Cannot be set if the transport_portocol is TLS. """ - external_uac_settings: UacExternalSettingsParam + external_uac_settings: ExternalUacSettings """ External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. @@ -79,7 +76,7 @@ class UacConnectionCreateParams(TypedDict, total=False): Telnyx and are not accepted as request parameters. """ - internal_uac_settings: UacInternalSettingsParam + internal_uac_settings: InternalUacSettings """Internal Telnyx-side settings for a UAC connection.""" ios_push_credential_id: Optional[str] @@ -118,7 +115,7 @@ class UacConnectionCreateParams(TypedDict, total=False): use T38 on just one leg of the call depending on each leg's settings. """ - outbound: UacOutboundParam + outbound: Outbound password: str """The password to be used as part of the credentials. @@ -170,6 +167,58 @@ class UacConnectionCreateParams(TypedDict, total=False): """Specifies how many seconds to wait before timing out a webhook.""" +class ExternalUacSettings(TypedDict, total=False): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: str + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: str + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: str + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + class Inbound(TypedDict, total=False): """Inbound settings that can be supplied when creating or updating a UAC connection. @@ -235,3 +284,72 @@ class Inbound(TypedDict, total=False): timeout_2xx_secs: int """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class InternalUacSettings(TypedDict, total=False): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: str + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class Outbound(TypedDict, total=False): + ani_override: str + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Literal["always", "normal", "emergency"] + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: int + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: bool + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: bool + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: str + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: str + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ diff --git a/src/telnyx/types/uac_connection_create_response.py b/src/telnyx/types/uac_connection_create_response.py index 53442510..3b26c2e3 100644 --- a/src/telnyx/types/uac_connection_create_response.py +++ b/src/telnyx/types/uac_connection_create_response.py @@ -1,15 +1,397 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal +from .fqdn import Fqdn from .._models import BaseModel -from .uac_connection import UacConnection +from .dtmf_type import DtmfType +from .encrypted_media import EncryptedMedia +from .anchorsite_override import AnchorsiteOverride +from .connection_rtcp_settings import ConnectionRtcpSettings +from .shared.connection_jitter_buffer import ConnectionJitterBuffer +from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionCreateResponse"] +__all__ = [ + "UacConnectionCreateResponse", + "Data", + "DataExternalUacSettings", + "DataInbound", + "DataInternalUacSettings", + "DataOutbound", +] + + +class DataExternalUacSettings(BaseModel): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] = None + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] = None + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] = None + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] = None + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: Optional[str] = None + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: Optional[str] = None + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] = None + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: Optional[str] = None + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + +class DataInbound(BaseModel): + ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None + """ + This setting allows you to set the format with which the caller's number (ANI) + is sent for inbound phone calls. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of inbound calls to phone numbers + associated with this connection. + """ + + codecs: Optional[List[str]] = None + """ + Defines the list of codecs that Telnyx will send for inbound calls to a specific + number on your portal account, in priority order. This only works when the + Connection the number is assigned to uses Media Handling mode: default. OPUS and + H.264 codecs are available only when using TCP or TLS transport for SIP. + """ + + default_routing_method: Optional[Literal["sequential", "round-robin"]] = None + """ + Default routing method to be used when a number is associated with the + connection. Must be one of the routing method types or left blank, other values + are not allowed. + """ + + dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + isup_headers_enabled: Optional[bool] = None + """When set, inbound phone calls will receive ISUP parameters via SIP headers. + + (Only when available and only when using TCP or TLS transport.) + """ + + prack_enabled: Optional[bool] = None + """Enable PRACK messages as defined in RFC3262.""" + + shaken_stir_enabled: Optional[bool] = None + """ + When enabled the SIP Connection will receive the Identity header with + Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP + transport. + """ + + simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None + """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" + + sip_compact_headers_enabled: Optional[bool] = None + """Defaults to true.""" + + sip_subdomain: Optional[str] = None + """The Telnyx-generated SIP subdomain for this UAC connection.""" + + sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None + """Controls which SIP URI callers may reach this connection.""" + + timeout_1xx_secs: Optional[int] = None + """Time(sec) before aborting if connection is not made.""" + + timeout_2xx_secs: Optional[int] = None + """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class DataInternalUacSettings(BaseModel): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: Optional[str] = None + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class DataOutbound(BaseModel): + ani_override: Optional[str] = None + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] = None + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: Optional[bool] = None + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: Optional[str] = None + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: Optional[str] = None + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Optional[ + Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + ] = None + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ + + +class Data(BaseModel): + """ + A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. + """ + + id: Optional[str] = None + """Identifies the type of resource.""" + + active: Optional[bool] = None + """Defaults to true""" + + anchorsite_override: Optional[AnchorsiteOverride] = None + """ + `Latency` directs Telnyx to route media through the site with the lowest + round-trip time to the user's connection. Telnyx calculates this time using ICMP + ping messages. This can be disabled by specifying a site to handle all media. + """ + + android_push_credential_id: Optional[str] = None + """The uuid of the push credential for Android""" + + authentication: Optional[Literal["uac-authentication"]] = None + """The authentication strategy used by this connection.""" + + call_cost_in_webhooks: Optional[bool] = None + """Specifies if call cost webhooks should be sent for this connection.""" + + connection_name: Optional[str] = None + + created_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was created.""" + + default_on_hold_comfort_noise_enabled: Optional[bool] = None + """When enabled, Telnyx will generate comfort noise when you place the call on + hold. + + If disabled, you will need to generate comfort noise or on hold music to avoid + RTP timeout. + """ + + dtmf_type: Optional[DtmfType] = None + """Sets the type of DTMF digits sent from Telnyx to this Connection. + + Note that DTMF digits sent to Telnyx will be accepted in all formats. + """ + + encode_contact_header_enabled: Optional[bool] = None + """ + Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG + scenarios. + """ + + encrypted_media: Optional[EncryptedMedia] = None + """Enable use of SRTP for encryption. + + Cannot be set if the transport_portocol is TLS. + """ + + external_uac_settings: Optional[DataExternalUacSettings] = None + """ + External SIP peer settings used by Telnyx when registering to your PBX and + routing outbound calls. + """ + + fqdn: Optional[str] = None + """The Telnyx-managed FQDN generated for the UAC connection.""" + + fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None + """The fixed outbound authentication mode used by UAC FQDN records.""" + + fqdns: Optional[List[Fqdn]] = None + """FQDN records managed automatically by the UAC connection lifecycle.""" + + inbound: Optional[DataInbound] = None + + internal_uac_settings: Optional[DataInternalUacSettings] = None + """Internal Telnyx-side settings for a UAC connection.""" + + ios_push_credential_id: Optional[str] = None + """The uuid of the push credential for Ios""" + + jitter_buffer: Optional[ConnectionJitterBuffer] = None + """Configuration options for Jitter Buffer. + + Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off + unless enabled. You may define min and max values in msec for customized + buffering behaviors. Larger values add latency but tolerate more jitter, while + smaller values reduce latency but are more sensitive to jitter and reordering. + """ + + noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None + """Controls when noise suppression is applied to calls. + + When set to 'inbound', noise suppression is applied to incoming audio. When set + to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied + in both directions. When set to 'disabled', noise suppression is turned off. + """ + + noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None + """Configuration options for noise suppression. + + These settings are stored regardless of the noise_suppression value, but only + take effect when noise_suppression is not 'disabled'. If you disable noise + suppression and later re-enable it, the previously configured settings will be + used. + """ + + onnet_t38_passthrough_enabled: Optional[bool] = None + """ + Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly + if both are on the Telnyx network. If this is disabled, Telnyx will be able to + use T38 on just one leg of the call depending on each leg's settings. + """ + + outbound: Optional[DataOutbound] = None + + password: Optional[str] = None + """The password to be used as part of the credentials. + + Must be 8 to 128 characters long. + """ + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + registration_status: Optional[str] = None + """The most recently known SIP registration status for this UAC connection.""" + + registration_status_updated_at: Optional[str] = None + """ + ISO 8601 formatted date indicating when the registration status was last + updated. + """ + + rtcp_settings: Optional[ConnectionRtcpSettings] = None + + sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None + """This feature enables inbound SIP URI calls to your Credential Auth Connection. + + If enabled for all (unrestricted) then anyone who calls the SIP URI + @telnyx.com will be connected to your Connection. You can also + choose to allow only calls that are originated on any Connections under your + account (internal). + """ + + tags: Optional[List[str]] = None + """Tags associated with the connection.""" + + updated_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was updated.""" + + user_name: Optional[str] = None + """The user name to be used as part of the credentials. + + Must be 4-32 characters long and alphanumeric values only (no spaces or special + characters). At least one of the first 5 characters must be a letter. + """ + + webhook_api_version: Optional[Literal["1", "2"]] = None + """Determines which webhook format will be used, Telnyx API v1 or v2.""" + + webhook_event_failover_url: Optional[str] = None + """ + The failover URL where webhooks related to this connection will be sent if + sending to the primary URL fails. Must include a scheme, such as 'https'. + """ + + webhook_event_url: Optional[str] = None + """The URL where webhooks related to this connection will be sent. + + Must include a scheme, such as 'https'. + """ + + webhook_timeout_secs: Optional[int] = None + """Specifies how many seconds to wait before timing out a webhook.""" class UacConnectionCreateResponse(BaseModel): - data: Optional[UacConnection] = None + data: Optional[Data] = None """ A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your diff --git a/src/telnyx/types/uac_connection_delete_response.py b/src/telnyx/types/uac_connection_delete_response.py index f21476d0..48377528 100644 --- a/src/telnyx/types/uac_connection_delete_response.py +++ b/src/telnyx/types/uac_connection_delete_response.py @@ -1,15 +1,397 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal +from .fqdn import Fqdn from .._models import BaseModel -from .uac_connection import UacConnection +from .dtmf_type import DtmfType +from .encrypted_media import EncryptedMedia +from .anchorsite_override import AnchorsiteOverride +from .connection_rtcp_settings import ConnectionRtcpSettings +from .shared.connection_jitter_buffer import ConnectionJitterBuffer +from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionDeleteResponse"] +__all__ = [ + "UacConnectionDeleteResponse", + "Data", + "DataExternalUacSettings", + "DataInbound", + "DataInternalUacSettings", + "DataOutbound", +] + + +class DataExternalUacSettings(BaseModel): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] = None + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] = None + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] = None + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] = None + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: Optional[str] = None + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: Optional[str] = None + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] = None + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: Optional[str] = None + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + +class DataInbound(BaseModel): + ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None + """ + This setting allows you to set the format with which the caller's number (ANI) + is sent for inbound phone calls. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of inbound calls to phone numbers + associated with this connection. + """ + + codecs: Optional[List[str]] = None + """ + Defines the list of codecs that Telnyx will send for inbound calls to a specific + number on your portal account, in priority order. This only works when the + Connection the number is assigned to uses Media Handling mode: default. OPUS and + H.264 codecs are available only when using TCP or TLS transport for SIP. + """ + + default_routing_method: Optional[Literal["sequential", "round-robin"]] = None + """ + Default routing method to be used when a number is associated with the + connection. Must be one of the routing method types or left blank, other values + are not allowed. + """ + + dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + isup_headers_enabled: Optional[bool] = None + """When set, inbound phone calls will receive ISUP parameters via SIP headers. + + (Only when available and only when using TCP or TLS transport.) + """ + + prack_enabled: Optional[bool] = None + """Enable PRACK messages as defined in RFC3262.""" + + shaken_stir_enabled: Optional[bool] = None + """ + When enabled the SIP Connection will receive the Identity header with + Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP + transport. + """ + + simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None + """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" + + sip_compact_headers_enabled: Optional[bool] = None + """Defaults to true.""" + + sip_subdomain: Optional[str] = None + """The Telnyx-generated SIP subdomain for this UAC connection.""" + + sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None + """Controls which SIP URI callers may reach this connection.""" + + timeout_1xx_secs: Optional[int] = None + """Time(sec) before aborting if connection is not made.""" + + timeout_2xx_secs: Optional[int] = None + """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class DataInternalUacSettings(BaseModel): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: Optional[str] = None + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class DataOutbound(BaseModel): + ani_override: Optional[str] = None + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] = None + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: Optional[bool] = None + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: Optional[str] = None + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: Optional[str] = None + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Optional[ + Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + ] = None + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ + + +class Data(BaseModel): + """ + A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. + """ + + id: Optional[str] = None + """Identifies the type of resource.""" + + active: Optional[bool] = None + """Defaults to true""" + + anchorsite_override: Optional[AnchorsiteOverride] = None + """ + `Latency` directs Telnyx to route media through the site with the lowest + round-trip time to the user's connection. Telnyx calculates this time using ICMP + ping messages. This can be disabled by specifying a site to handle all media. + """ + + android_push_credential_id: Optional[str] = None + """The uuid of the push credential for Android""" + + authentication: Optional[Literal["uac-authentication"]] = None + """The authentication strategy used by this connection.""" + + call_cost_in_webhooks: Optional[bool] = None + """Specifies if call cost webhooks should be sent for this connection.""" + + connection_name: Optional[str] = None + + created_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was created.""" + + default_on_hold_comfort_noise_enabled: Optional[bool] = None + """When enabled, Telnyx will generate comfort noise when you place the call on + hold. + + If disabled, you will need to generate comfort noise or on hold music to avoid + RTP timeout. + """ + + dtmf_type: Optional[DtmfType] = None + """Sets the type of DTMF digits sent from Telnyx to this Connection. + + Note that DTMF digits sent to Telnyx will be accepted in all formats. + """ + + encode_contact_header_enabled: Optional[bool] = None + """ + Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG + scenarios. + """ + + encrypted_media: Optional[EncryptedMedia] = None + """Enable use of SRTP for encryption. + + Cannot be set if the transport_portocol is TLS. + """ + + external_uac_settings: Optional[DataExternalUacSettings] = None + """ + External SIP peer settings used by Telnyx when registering to your PBX and + routing outbound calls. + """ + + fqdn: Optional[str] = None + """The Telnyx-managed FQDN generated for the UAC connection.""" + + fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None + """The fixed outbound authentication mode used by UAC FQDN records.""" + + fqdns: Optional[List[Fqdn]] = None + """FQDN records managed automatically by the UAC connection lifecycle.""" + + inbound: Optional[DataInbound] = None + + internal_uac_settings: Optional[DataInternalUacSettings] = None + """Internal Telnyx-side settings for a UAC connection.""" + + ios_push_credential_id: Optional[str] = None + """The uuid of the push credential for Ios""" + + jitter_buffer: Optional[ConnectionJitterBuffer] = None + """Configuration options for Jitter Buffer. + + Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off + unless enabled. You may define min and max values in msec for customized + buffering behaviors. Larger values add latency but tolerate more jitter, while + smaller values reduce latency but are more sensitive to jitter and reordering. + """ + + noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None + """Controls when noise suppression is applied to calls. + + When set to 'inbound', noise suppression is applied to incoming audio. When set + to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied + in both directions. When set to 'disabled', noise suppression is turned off. + """ + + noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None + """Configuration options for noise suppression. + + These settings are stored regardless of the noise_suppression value, but only + take effect when noise_suppression is not 'disabled'. If you disable noise + suppression and later re-enable it, the previously configured settings will be + used. + """ + + onnet_t38_passthrough_enabled: Optional[bool] = None + """ + Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly + if both are on the Telnyx network. If this is disabled, Telnyx will be able to + use T38 on just one leg of the call depending on each leg's settings. + """ + + outbound: Optional[DataOutbound] = None + + password: Optional[str] = None + """The password to be used as part of the credentials. + + Must be 8 to 128 characters long. + """ + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + registration_status: Optional[str] = None + """The most recently known SIP registration status for this UAC connection.""" + + registration_status_updated_at: Optional[str] = None + """ + ISO 8601 formatted date indicating when the registration status was last + updated. + """ + + rtcp_settings: Optional[ConnectionRtcpSettings] = None + + sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None + """This feature enables inbound SIP URI calls to your Credential Auth Connection. + + If enabled for all (unrestricted) then anyone who calls the SIP URI + @telnyx.com will be connected to your Connection. You can also + choose to allow only calls that are originated on any Connections under your + account (internal). + """ + + tags: Optional[List[str]] = None + """Tags associated with the connection.""" + + updated_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was updated.""" + + user_name: Optional[str] = None + """The user name to be used as part of the credentials. + + Must be 4-32 characters long and alphanumeric values only (no spaces or special + characters). At least one of the first 5 characters must be a letter. + """ + + webhook_api_version: Optional[Literal["1", "2"]] = None + """Determines which webhook format will be used, Telnyx API v1 or v2.""" + + webhook_event_failover_url: Optional[str] = None + """ + The failover URL where webhooks related to this connection will be sent if + sending to the primary URL fails. Must include a scheme, such as 'https'. + """ + + webhook_event_url: Optional[str] = None + """The URL where webhooks related to this connection will be sent. + + Must include a scheme, such as 'https'. + """ + + webhook_timeout_secs: Optional[int] = None + """Specifies how many seconds to wait before timing out a webhook.""" class UacConnectionDeleteResponse(BaseModel): - data: Optional[UacConnection] = None + data: Optional[Data] = None """ A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your diff --git a/src/telnyx/types/uac_connection_list_response.py b/src/telnyx/types/uac_connection_list_response.py new file mode 100644 index 00000000..cc6ef7d0 --- /dev/null +++ b/src/telnyx/types/uac_connection_list_response.py @@ -0,0 +1,383 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .fqdn import Fqdn +from .._models import BaseModel +from .dtmf_type import DtmfType +from .encrypted_media import EncryptedMedia +from .anchorsite_override import AnchorsiteOverride +from .connection_rtcp_settings import ConnectionRtcpSettings +from .shared.connection_jitter_buffer import ConnectionJitterBuffer +from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails + +__all__ = ["UacConnectionListResponse", "ExternalUacSettings", "Inbound", "InternalUacSettings", "Outbound"] + + +class ExternalUacSettings(BaseModel): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] = None + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] = None + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] = None + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] = None + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: Optional[str] = None + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: Optional[str] = None + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] = None + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: Optional[str] = None + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + +class Inbound(BaseModel): + ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None + """ + This setting allows you to set the format with which the caller's number (ANI) + is sent for inbound phone calls. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of inbound calls to phone numbers + associated with this connection. + """ + + codecs: Optional[List[str]] = None + """ + Defines the list of codecs that Telnyx will send for inbound calls to a specific + number on your portal account, in priority order. This only works when the + Connection the number is assigned to uses Media Handling mode: default. OPUS and + H.264 codecs are available only when using TCP or TLS transport for SIP. + """ + + default_routing_method: Optional[Literal["sequential", "round-robin"]] = None + """ + Default routing method to be used when a number is associated with the + connection. Must be one of the routing method types or left blank, other values + are not allowed. + """ + + dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + isup_headers_enabled: Optional[bool] = None + """When set, inbound phone calls will receive ISUP parameters via SIP headers. + + (Only when available and only when using TCP or TLS transport.) + """ + + prack_enabled: Optional[bool] = None + """Enable PRACK messages as defined in RFC3262.""" + + shaken_stir_enabled: Optional[bool] = None + """ + When enabled the SIP Connection will receive the Identity header with + Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP + transport. + """ + + simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None + """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" + + sip_compact_headers_enabled: Optional[bool] = None + """Defaults to true.""" + + sip_subdomain: Optional[str] = None + """The Telnyx-generated SIP subdomain for this UAC connection.""" + + sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None + """Controls which SIP URI callers may reach this connection.""" + + timeout_1xx_secs: Optional[int] = None + """Time(sec) before aborting if connection is not made.""" + + timeout_2xx_secs: Optional[int] = None + """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class InternalUacSettings(BaseModel): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: Optional[str] = None + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class Outbound(BaseModel): + ani_override: Optional[str] = None + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] = None + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: Optional[bool] = None + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: Optional[str] = None + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: Optional[str] = None + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Optional[ + Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + ] = None + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ + + +class UacConnectionListResponse(BaseModel): + """ + A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. + """ + + id: Optional[str] = None + """Identifies the type of resource.""" + + active: Optional[bool] = None + """Defaults to true""" + + anchorsite_override: Optional[AnchorsiteOverride] = None + """ + `Latency` directs Telnyx to route media through the site with the lowest + round-trip time to the user's connection. Telnyx calculates this time using ICMP + ping messages. This can be disabled by specifying a site to handle all media. + """ + + android_push_credential_id: Optional[str] = None + """The uuid of the push credential for Android""" + + authentication: Optional[Literal["uac-authentication"]] = None + """The authentication strategy used by this connection.""" + + call_cost_in_webhooks: Optional[bool] = None + """Specifies if call cost webhooks should be sent for this connection.""" + + connection_name: Optional[str] = None + + created_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was created.""" + + default_on_hold_comfort_noise_enabled: Optional[bool] = None + """When enabled, Telnyx will generate comfort noise when you place the call on + hold. + + If disabled, you will need to generate comfort noise or on hold music to avoid + RTP timeout. + """ + + dtmf_type: Optional[DtmfType] = None + """Sets the type of DTMF digits sent from Telnyx to this Connection. + + Note that DTMF digits sent to Telnyx will be accepted in all formats. + """ + + encode_contact_header_enabled: Optional[bool] = None + """ + Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG + scenarios. + """ + + encrypted_media: Optional[EncryptedMedia] = None + """Enable use of SRTP for encryption. + + Cannot be set if the transport_portocol is TLS. + """ + + external_uac_settings: Optional[ExternalUacSettings] = None + """ + External SIP peer settings used by Telnyx when registering to your PBX and + routing outbound calls. + """ + + fqdn: Optional[str] = None + """The Telnyx-managed FQDN generated for the UAC connection.""" + + fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None + """The fixed outbound authentication mode used by UAC FQDN records.""" + + fqdns: Optional[List[Fqdn]] = None + """FQDN records managed automatically by the UAC connection lifecycle.""" + + inbound: Optional[Inbound] = None + + internal_uac_settings: Optional[InternalUacSettings] = None + """Internal Telnyx-side settings for a UAC connection.""" + + ios_push_credential_id: Optional[str] = None + """The uuid of the push credential for Ios""" + + jitter_buffer: Optional[ConnectionJitterBuffer] = None + """Configuration options for Jitter Buffer. + + Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off + unless enabled. You may define min and max values in msec for customized + buffering behaviors. Larger values add latency but tolerate more jitter, while + smaller values reduce latency but are more sensitive to jitter and reordering. + """ + + noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None + """Controls when noise suppression is applied to calls. + + When set to 'inbound', noise suppression is applied to incoming audio. When set + to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied + in both directions. When set to 'disabled', noise suppression is turned off. + """ + + noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None + """Configuration options for noise suppression. + + These settings are stored regardless of the noise_suppression value, but only + take effect when noise_suppression is not 'disabled'. If you disable noise + suppression and later re-enable it, the previously configured settings will be + used. + """ + + onnet_t38_passthrough_enabled: Optional[bool] = None + """ + Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly + if both are on the Telnyx network. If this is disabled, Telnyx will be able to + use T38 on just one leg of the call depending on each leg's settings. + """ + + outbound: Optional[Outbound] = None + + password: Optional[str] = None + """The password to be used as part of the credentials. + + Must be 8 to 128 characters long. + """ + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + registration_status: Optional[str] = None + """The most recently known SIP registration status for this UAC connection.""" + + registration_status_updated_at: Optional[str] = None + """ + ISO 8601 formatted date indicating when the registration status was last + updated. + """ + + rtcp_settings: Optional[ConnectionRtcpSettings] = None + + sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None + """This feature enables inbound SIP URI calls to your Credential Auth Connection. + + If enabled for all (unrestricted) then anyone who calls the SIP URI + @telnyx.com will be connected to your Connection. You can also + choose to allow only calls that are originated on any Connections under your + account (internal). + """ + + tags: Optional[List[str]] = None + """Tags associated with the connection.""" + + updated_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was updated.""" + + user_name: Optional[str] = None + """The user name to be used as part of the credentials. + + Must be 4-32 characters long and alphanumeric values only (no spaces or special + characters). At least one of the first 5 characters must be a letter. + """ + + webhook_api_version: Optional[Literal["1", "2"]] = None + """Determines which webhook format will be used, Telnyx API v1 or v2.""" + + webhook_event_failover_url: Optional[str] = None + """ + The failover URL where webhooks related to this connection will be sent if + sending to the primary URL fails. Must include a scheme, such as 'https'. + """ + + webhook_event_url: Optional[str] = None + """The URL where webhooks related to this connection will be sent. + + Must include a scheme, such as 'https'. + """ + + webhook_timeout_secs: Optional[int] = None + """Specifies how many seconds to wait before timing out a webhook.""" diff --git a/src/telnyx/types/uac_connection_retrieve_response.py b/src/telnyx/types/uac_connection_retrieve_response.py index f48bcb8f..59e49d50 100644 --- a/src/telnyx/types/uac_connection_retrieve_response.py +++ b/src/telnyx/types/uac_connection_retrieve_response.py @@ -1,15 +1,397 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal +from .fqdn import Fqdn from .._models import BaseModel -from .uac_connection import UacConnection +from .dtmf_type import DtmfType +from .encrypted_media import EncryptedMedia +from .anchorsite_override import AnchorsiteOverride +from .connection_rtcp_settings import ConnectionRtcpSettings +from .shared.connection_jitter_buffer import ConnectionJitterBuffer +from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionRetrieveResponse"] +__all__ = [ + "UacConnectionRetrieveResponse", + "Data", + "DataExternalUacSettings", + "DataInbound", + "DataInternalUacSettings", + "DataOutbound", +] + + +class DataExternalUacSettings(BaseModel): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] = None + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] = None + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] = None + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] = None + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: Optional[str] = None + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: Optional[str] = None + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] = None + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: Optional[str] = None + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + +class DataInbound(BaseModel): + ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None + """ + This setting allows you to set the format with which the caller's number (ANI) + is sent for inbound phone calls. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of inbound calls to phone numbers + associated with this connection. + """ + + codecs: Optional[List[str]] = None + """ + Defines the list of codecs that Telnyx will send for inbound calls to a specific + number on your portal account, in priority order. This only works when the + Connection the number is assigned to uses Media Handling mode: default. OPUS and + H.264 codecs are available only when using TCP or TLS transport for SIP. + """ + + default_routing_method: Optional[Literal["sequential", "round-robin"]] = None + """ + Default routing method to be used when a number is associated with the + connection. Must be one of the routing method types or left blank, other values + are not allowed. + """ + + dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + isup_headers_enabled: Optional[bool] = None + """When set, inbound phone calls will receive ISUP parameters via SIP headers. + + (Only when available and only when using TCP or TLS transport.) + """ + + prack_enabled: Optional[bool] = None + """Enable PRACK messages as defined in RFC3262.""" + + shaken_stir_enabled: Optional[bool] = None + """ + When enabled the SIP Connection will receive the Identity header with + Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP + transport. + """ + + simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None + """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" + + sip_compact_headers_enabled: Optional[bool] = None + """Defaults to true.""" + + sip_subdomain: Optional[str] = None + """The Telnyx-generated SIP subdomain for this UAC connection.""" + + sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None + """Controls which SIP URI callers may reach this connection.""" + + timeout_1xx_secs: Optional[int] = None + """Time(sec) before aborting if connection is not made.""" + + timeout_2xx_secs: Optional[int] = None + """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class DataInternalUacSettings(BaseModel): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: Optional[str] = None + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class DataOutbound(BaseModel): + ani_override: Optional[str] = None + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] = None + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: Optional[bool] = None + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: Optional[str] = None + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: Optional[str] = None + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Optional[ + Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + ] = None + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ + + +class Data(BaseModel): + """ + A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. + """ + + id: Optional[str] = None + """Identifies the type of resource.""" + + active: Optional[bool] = None + """Defaults to true""" + + anchorsite_override: Optional[AnchorsiteOverride] = None + """ + `Latency` directs Telnyx to route media through the site with the lowest + round-trip time to the user's connection. Telnyx calculates this time using ICMP + ping messages. This can be disabled by specifying a site to handle all media. + """ + + android_push_credential_id: Optional[str] = None + """The uuid of the push credential for Android""" + + authentication: Optional[Literal["uac-authentication"]] = None + """The authentication strategy used by this connection.""" + + call_cost_in_webhooks: Optional[bool] = None + """Specifies if call cost webhooks should be sent for this connection.""" + + connection_name: Optional[str] = None + + created_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was created.""" + + default_on_hold_comfort_noise_enabled: Optional[bool] = None + """When enabled, Telnyx will generate comfort noise when you place the call on + hold. + + If disabled, you will need to generate comfort noise or on hold music to avoid + RTP timeout. + """ + + dtmf_type: Optional[DtmfType] = None + """Sets the type of DTMF digits sent from Telnyx to this Connection. + + Note that DTMF digits sent to Telnyx will be accepted in all formats. + """ + + encode_contact_header_enabled: Optional[bool] = None + """ + Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG + scenarios. + """ + + encrypted_media: Optional[EncryptedMedia] = None + """Enable use of SRTP for encryption. + + Cannot be set if the transport_portocol is TLS. + """ + + external_uac_settings: Optional[DataExternalUacSettings] = None + """ + External SIP peer settings used by Telnyx when registering to your PBX and + routing outbound calls. + """ + + fqdn: Optional[str] = None + """The Telnyx-managed FQDN generated for the UAC connection.""" + + fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None + """The fixed outbound authentication mode used by UAC FQDN records.""" + + fqdns: Optional[List[Fqdn]] = None + """FQDN records managed automatically by the UAC connection lifecycle.""" + + inbound: Optional[DataInbound] = None + + internal_uac_settings: Optional[DataInternalUacSettings] = None + """Internal Telnyx-side settings for a UAC connection.""" + + ios_push_credential_id: Optional[str] = None + """The uuid of the push credential for Ios""" + + jitter_buffer: Optional[ConnectionJitterBuffer] = None + """Configuration options for Jitter Buffer. + + Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off + unless enabled. You may define min and max values in msec for customized + buffering behaviors. Larger values add latency but tolerate more jitter, while + smaller values reduce latency but are more sensitive to jitter and reordering. + """ + + noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None + """Controls when noise suppression is applied to calls. + + When set to 'inbound', noise suppression is applied to incoming audio. When set + to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied + in both directions. When set to 'disabled', noise suppression is turned off. + """ + + noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None + """Configuration options for noise suppression. + + These settings are stored regardless of the noise_suppression value, but only + take effect when noise_suppression is not 'disabled'. If you disable noise + suppression and later re-enable it, the previously configured settings will be + used. + """ + + onnet_t38_passthrough_enabled: Optional[bool] = None + """ + Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly + if both are on the Telnyx network. If this is disabled, Telnyx will be able to + use T38 on just one leg of the call depending on each leg's settings. + """ + + outbound: Optional[DataOutbound] = None + + password: Optional[str] = None + """The password to be used as part of the credentials. + + Must be 8 to 128 characters long. + """ + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + registration_status: Optional[str] = None + """The most recently known SIP registration status for this UAC connection.""" + + registration_status_updated_at: Optional[str] = None + """ + ISO 8601 formatted date indicating when the registration status was last + updated. + """ + + rtcp_settings: Optional[ConnectionRtcpSettings] = None + + sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None + """This feature enables inbound SIP URI calls to your Credential Auth Connection. + + If enabled for all (unrestricted) then anyone who calls the SIP URI + @telnyx.com will be connected to your Connection. You can also + choose to allow only calls that are originated on any Connections under your + account (internal). + """ + + tags: Optional[List[str]] = None + """Tags associated with the connection.""" + + updated_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was updated.""" + + user_name: Optional[str] = None + """The user name to be used as part of the credentials. + + Must be 4-32 characters long and alphanumeric values only (no spaces or special + characters). At least one of the first 5 characters must be a letter. + """ + + webhook_api_version: Optional[Literal["1", "2"]] = None + """Determines which webhook format will be used, Telnyx API v1 or v2.""" + + webhook_event_failover_url: Optional[str] = None + """ + The failover URL where webhooks related to this connection will be sent if + sending to the primary URL fails. Must include a scheme, such as 'https'. + """ + + webhook_event_url: Optional[str] = None + """The URL where webhooks related to this connection will be sent. + + Must include a scheme, such as 'https'. + """ + + webhook_timeout_secs: Optional[int] = None + """Specifies how many seconds to wait before timing out a webhook.""" class UacConnectionRetrieveResponse(BaseModel): - data: Optional[UacConnection] = None + data: Optional[Data] = None """ A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your diff --git a/src/telnyx/types/uac_connection_update_params.py b/src/telnyx/types/uac_connection_update_params.py index affb7b5b..222838d2 100644 --- a/src/telnyx/types/uac_connection_update_params.py +++ b/src/telnyx/types/uac_connection_update_params.py @@ -8,15 +8,12 @@ from .._types import SequenceNotStr from .dtmf_type import DtmfType from .encrypted_media import EncryptedMedia -from .uac_outbound_param import UacOutboundParam from .anchorsite_override import AnchorsiteOverride -from .uac_external_settings_param import UacExternalSettingsParam -from .uac_internal_settings_param import UacInternalSettingsParam from .connection_rtcp_settings_param import ConnectionRtcpSettingsParam from .shared_params.connection_jitter_buffer import ConnectionJitterBuffer from .shared_params.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionUpdateParams", "Inbound"] +__all__ = ["UacConnectionUpdateParams", "ExternalUacSettings", "Inbound", "InternalUacSettings", "Outbound"] class UacConnectionUpdateParams(TypedDict, total=False): @@ -65,7 +62,7 @@ class UacConnectionUpdateParams(TypedDict, total=False): Cannot be set if the transport_portocol is TLS. """ - external_uac_settings: UacExternalSettingsParam + external_uac_settings: ExternalUacSettings """ External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. @@ -79,7 +76,7 @@ class UacConnectionUpdateParams(TypedDict, total=False): Telnyx and are not accepted as request parameters. """ - internal_uac_settings: UacInternalSettingsParam + internal_uac_settings: InternalUacSettings """Internal Telnyx-side settings for a UAC connection.""" ios_push_credential_id: Optional[str] @@ -118,7 +115,7 @@ class UacConnectionUpdateParams(TypedDict, total=False): use T38 on just one leg of the call depending on each leg's settings. """ - outbound: UacOutboundParam + outbound: Outbound password: str """The password to be used as part of the credentials. @@ -166,6 +163,58 @@ class UacConnectionUpdateParams(TypedDict, total=False): """Specifies how many seconds to wait before timing out a webhook.""" +class ExternalUacSettings(TypedDict, total=False): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: str + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: str + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: str + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + class Inbound(TypedDict, total=False): """Inbound settings that can be supplied when creating or updating a UAC connection. @@ -231,3 +280,72 @@ class Inbound(TypedDict, total=False): timeout_2xx_secs: int """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class InternalUacSettings(TypedDict, total=False): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: str + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class Outbound(TypedDict, total=False): + ani_override: str + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Literal["always", "normal", "emergency"] + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: int + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: bool + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: bool + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: str + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: str + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ diff --git a/src/telnyx/types/uac_connection_update_response.py b/src/telnyx/types/uac_connection_update_response.py index 24090ac8..58e44a1b 100644 --- a/src/telnyx/types/uac_connection_update_response.py +++ b/src/telnyx/types/uac_connection_update_response.py @@ -1,15 +1,397 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal +from .fqdn import Fqdn from .._models import BaseModel -from .uac_connection import UacConnection +from .dtmf_type import DtmfType +from .encrypted_media import EncryptedMedia +from .anchorsite_override import AnchorsiteOverride +from .connection_rtcp_settings import ConnectionRtcpSettings +from .shared.connection_jitter_buffer import ConnectionJitterBuffer +from .shared.connection_noise_suppression_details import ConnectionNoiseSuppressionDetails -__all__ = ["UacConnectionUpdateResponse"] +__all__ = [ + "UacConnectionUpdateResponse", + "Data", + "DataExternalUacSettings", + "DataInbound", + "DataInternalUacSettings", + "DataOutbound", +] + + +class DataExternalUacSettings(BaseModel): + """ + External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. + """ + + auth_username: Optional[str] = None + """The authentication username used in SIP digest authentication. + + If not set, the Username value will be used. + """ + + expiration_sec: Optional[int] = None + """ + The registration interval, in seconds, indicating how often the system refreshes + the SIP registration with the external SIP peer. + """ + + from_user: Optional[str] = None + """The user portion of the SIP From header used in outbound requests. + + This controls the caller identity presented to the external SIP peer. + """ + + outbound_proxy: Optional[str] = None + """ + An optional SIP proxy used to route outbound requests before reaching the + external SIP peer. + """ + + password: Optional[str] = None + """The SIP password used for digest authentication with the external SIP peer.""" + + proxy: Optional[str] = None + """ + The SIP proxy address of the external SIP peer used for registrations and + outbound call routing. + """ + + transport: Optional[Literal["UDP", "TLS", "TCP"]] = None + """ + The transport protocol used for SIP signaling when communicating with the + external SIP peer. One of UDP, TLS, or TCP. + """ + + username: Optional[str] = None + """ + The SIP username used to authenticate with the external SIP peer for + registrations and outbound calls. Must start with a letter or number and contain + only letters, numbers, hyphens, and underscores. + """ + + +class DataInbound(BaseModel): + ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None + """ + This setting allows you to set the format with which the caller's number (ANI) + is sent for inbound phone calls. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of inbound calls to phone numbers + associated with this connection. + """ + + codecs: Optional[List[str]] = None + """ + Defines the list of codecs that Telnyx will send for inbound calls to a specific + number on your portal account, in priority order. This only works when the + Connection the number is assigned to uses Media Handling mode: default. OPUS and + H.264 codecs are available only when using TCP or TLS transport for SIP. + """ + + default_routing_method: Optional[Literal["sequential", "round-robin"]] = None + """ + Default routing method to be used when a number is associated with the + connection. Must be one of the routing method types or left blank, other values + are not allowed. + """ + + dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + isup_headers_enabled: Optional[bool] = None + """When set, inbound phone calls will receive ISUP parameters via SIP headers. + + (Only when available and only when using TCP or TLS transport.) + """ + + prack_enabled: Optional[bool] = None + """Enable PRACK messages as defined in RFC3262.""" + + shaken_stir_enabled: Optional[bool] = None + """ + When enabled the SIP Connection will receive the Identity header with + Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP + transport. + """ + + simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None + """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" + + sip_compact_headers_enabled: Optional[bool] = None + """Defaults to true.""" + + sip_subdomain: Optional[str] = None + """The Telnyx-generated SIP subdomain for this UAC connection.""" + + sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None + """Controls which SIP URI callers may reach this connection.""" + + timeout_1xx_secs: Optional[int] = None + """Time(sec) before aborting if connection is not made.""" + + timeout_2xx_secs: Optional[int] = None + """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" + + +class DataInternalUacSettings(BaseModel): + """Internal Telnyx-side settings for a UAC connection.""" + + destination_uri: Optional[str] = None + """ + The SIP URI that Telnyx will call when handling an inbound request from the + external peer. Do not include a `sip:` prefix. The value must be in the format + `userinfo@sip.telnyx.com` or + `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only + letters, digits, hyphens, and underscores. + """ + + +class DataOutbound(BaseModel): + ani_override: Optional[str] = None + """ + Set a phone number as the ani_override value to override caller id number on + outbound calls. + """ + + ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None + """Specifies when we apply your ani_override setting. + + Only applies when ani_override is not blank. + """ + + call_parking_enabled: Optional[bool] = None + """ + Forces all SIP calls originated on this connection to be "parked" instead of + "bridged" to the destination specified on the URI. Parked calls will return + ringback to the caller and will await for a Call Control command to define which + action will be taken next. + """ + + channel_limit: Optional[int] = None + """ + When set, this will limit the total number of outbound calls to phone numbers + associated with this connection. + """ + + generate_ringback_tone: Optional[bool] = None + """Generate ringback tone through 183 session progress message with early media.""" + + instant_ringback_enabled: Optional[bool] = None + """ + When set, ringback will not wait for indication before sending ringback tone to + calling party. + """ + + localization: Optional[str] = None + """ + A 2-character country code specifying the country whose national dialing rules + should be used. For example, if set to `US` then any US number can be dialed + without preprending +1 to the number. When left blank, Telnyx will try US and GB + dialing rules, in that order, by default. + """ + + outbound_voice_profile_id: Optional[str] = None + """Identifies the associated outbound voice profile.""" + + t38_reinvite_source: Optional[ + Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] + ] = None + """This setting only affects connections with Fax-type Outbound Voice Profiles. + + The setting dictates whether or not Telnyx sends a t.38 reinvite.

By + default, Telnyx will send the re-invite. If set to `customer`, the caller is + expected to send the t.38 reinvite. + """ + + +class Data(BaseModel): + """ + A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your PBX doesn’t support outbound SIP registration or you need Telnyx to maintain the registration. + """ + + id: Optional[str] = None + """Identifies the type of resource.""" + + active: Optional[bool] = None + """Defaults to true""" + + anchorsite_override: Optional[AnchorsiteOverride] = None + """ + `Latency` directs Telnyx to route media through the site with the lowest + round-trip time to the user's connection. Telnyx calculates this time using ICMP + ping messages. This can be disabled by specifying a site to handle all media. + """ + + android_push_credential_id: Optional[str] = None + """The uuid of the push credential for Android""" + + authentication: Optional[Literal["uac-authentication"]] = None + """The authentication strategy used by this connection.""" + + call_cost_in_webhooks: Optional[bool] = None + """Specifies if call cost webhooks should be sent for this connection.""" + + connection_name: Optional[str] = None + + created_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was created.""" + + default_on_hold_comfort_noise_enabled: Optional[bool] = None + """When enabled, Telnyx will generate comfort noise when you place the call on + hold. + + If disabled, you will need to generate comfort noise or on hold music to avoid + RTP timeout. + """ + + dtmf_type: Optional[DtmfType] = None + """Sets the type of DTMF digits sent from Telnyx to this Connection. + + Note that DTMF digits sent to Telnyx will be accepted in all formats. + """ + + encode_contact_header_enabled: Optional[bool] = None + """ + Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG + scenarios. + """ + + encrypted_media: Optional[EncryptedMedia] = None + """Enable use of SRTP for encryption. + + Cannot be set if the transport_portocol is TLS. + """ + + external_uac_settings: Optional[DataExternalUacSettings] = None + """ + External SIP peer settings used by Telnyx when registering to your PBX and + routing outbound calls. + """ + + fqdn: Optional[str] = None + """The Telnyx-managed FQDN generated for the UAC connection.""" + + fqdn_outbound_authentication: Optional[Literal["credential-authentication"]] = None + """The fixed outbound authentication mode used by UAC FQDN records.""" + + fqdns: Optional[List[Fqdn]] = None + """FQDN records managed automatically by the UAC connection lifecycle.""" + + inbound: Optional[DataInbound] = None + + internal_uac_settings: Optional[DataInternalUacSettings] = None + """Internal Telnyx-side settings for a UAC connection.""" + + ios_push_credential_id: Optional[str] = None + """The uuid of the push credential for Ios""" + + jitter_buffer: Optional[ConnectionJitterBuffer] = None + """Configuration options for Jitter Buffer. + + Enables Jitter Buffer for RTP streams of SIP Trunking calls. The feature is off + unless enabled. You may define min and max values in msec for customized + buffering behaviors. Larger values add latency but tolerate more jitter, while + smaller values reduce latency but are more sensitive to jitter and reordering. + """ + + noise_suppression: Optional[Literal["inbound", "outbound", "both", "disabled"]] = None + """Controls when noise suppression is applied to calls. + + When set to 'inbound', noise suppression is applied to incoming audio. When set + to 'outbound', it's applied to outgoing audio. When set to 'both', it's applied + in both directions. When set to 'disabled', noise suppression is turned off. + """ + + noise_suppression_details: Optional[ConnectionNoiseSuppressionDetails] = None + """Configuration options for noise suppression. + + These settings are stored regardless of the noise_suppression value, but only + take effect when noise_suppression is not 'disabled'. If you disable noise + suppression and later re-enable it, the previously configured settings will be + used. + """ + + onnet_t38_passthrough_enabled: Optional[bool] = None + """ + Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly + if both are on the Telnyx network. If this is disabled, Telnyx will be able to + use T38 on just one leg of the call depending on each leg's settings. + """ + + outbound: Optional[DataOutbound] = None + + password: Optional[str] = None + """The password to be used as part of the credentials. + + Must be 8 to 128 characters long. + """ + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + registration_status: Optional[str] = None + """The most recently known SIP registration status for this UAC connection.""" + + registration_status_updated_at: Optional[str] = None + """ + ISO 8601 formatted date indicating when the registration status was last + updated. + """ + + rtcp_settings: Optional[ConnectionRtcpSettings] = None + + sip_uri_calling_preference: Optional[Literal["disabled", "unrestricted", "internal"]] = None + """This feature enables inbound SIP URI calls to your Credential Auth Connection. + + If enabled for all (unrestricted) then anyone who calls the SIP URI + @telnyx.com will be connected to your Connection. You can also + choose to allow only calls that are originated on any Connections under your + account (internal). + """ + + tags: Optional[List[str]] = None + """Tags associated with the connection.""" + + updated_at: Optional[str] = None + """ISO-8601 formatted date indicating when the resource was updated.""" + + user_name: Optional[str] = None + """The user name to be used as part of the credentials. + + Must be 4-32 characters long and alphanumeric values only (no spaces or special + characters). At least one of the first 5 characters must be a letter. + """ + + webhook_api_version: Optional[Literal["1", "2"]] = None + """Determines which webhook format will be used, Telnyx API v1 or v2.""" + + webhook_event_failover_url: Optional[str] = None + """ + The failover URL where webhooks related to this connection will be sent if + sending to the primary URL fails. Must include a scheme, such as 'https'. + """ + + webhook_event_url: Optional[str] = None + """The URL where webhooks related to this connection will be sent. + + Must include a scheme, such as 'https'. + """ + + webhook_timeout_secs: Optional[int] = None + """Specifies how many seconds to wait before timing out a webhook.""" class UacConnectionUpdateResponse(BaseModel): - data: Optional[UacConnection] = None + data: Optional[Data] = None """ A UAC (User Agent Client) Connection registers Telnyx to your PBX — the opposite of a standard SIP trunk, where the PBX registers to Telnyx. Use UAC when your diff --git a/src/telnyx/types/uac_external_settings.py b/src/telnyx/types/uac_external_settings.py deleted file mode 100644 index e0c5feba..00000000 --- a/src/telnyx/types/uac_external_settings.py +++ /dev/null @@ -1,60 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["UacExternalSettings"] - - -class UacExternalSettings(BaseModel): - """ - External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. - """ - - auth_username: Optional[str] = None - """The authentication username used in SIP digest authentication. - - If not set, the Username value will be used. - """ - - expiration_sec: Optional[int] = None - """ - The registration interval, in seconds, indicating how often the system refreshes - the SIP registration with the external SIP peer. - """ - - from_user: Optional[str] = None - """The user portion of the SIP From header used in outbound requests. - - This controls the caller identity presented to the external SIP peer. - """ - - outbound_proxy: Optional[str] = None - """ - An optional SIP proxy used to route outbound requests before reaching the - external SIP peer. - """ - - password: Optional[str] = None - """The SIP password used for digest authentication with the external SIP peer.""" - - proxy: Optional[str] = None - """ - The SIP proxy address of the external SIP peer used for registrations and - outbound call routing. - """ - - transport: Optional[Literal["UDP", "TLS", "TCP"]] = None - """ - The transport protocol used for SIP signaling when communicating with the - external SIP peer. One of UDP, TLS, or TCP. - """ - - username: Optional[str] = None - """ - The SIP username used to authenticate with the external SIP peer for - registrations and outbound calls. Must start with a letter or number and contain - only letters, numbers, hyphens, and underscores. - """ diff --git a/src/telnyx/types/uac_external_settings_param.py b/src/telnyx/types/uac_external_settings_param.py deleted file mode 100644 index e544ffdf..00000000 --- a/src/telnyx/types/uac_external_settings_param.py +++ /dev/null @@ -1,60 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Literal, TypedDict - -__all__ = ["UacExternalSettingsParam"] - - -class UacExternalSettingsParam(TypedDict, total=False): - """ - External SIP peer settings used by Telnyx when registering to your PBX and routing outbound calls. - """ - - auth_username: Optional[str] - """The authentication username used in SIP digest authentication. - - If not set, the Username value will be used. - """ - - expiration_sec: Optional[int] - """ - The registration interval, in seconds, indicating how often the system refreshes - the SIP registration with the external SIP peer. - """ - - from_user: Optional[str] - """The user portion of the SIP From header used in outbound requests. - - This controls the caller identity presented to the external SIP peer. - """ - - outbound_proxy: Optional[str] - """ - An optional SIP proxy used to route outbound requests before reaching the - external SIP peer. - """ - - password: str - """The SIP password used for digest authentication with the external SIP peer.""" - - proxy: str - """ - The SIP proxy address of the external SIP peer used for registrations and - outbound call routing. - """ - - transport: Optional[Literal["UDP", "TLS", "TCP"]] - """ - The transport protocol used for SIP signaling when communicating with the - external SIP peer. One of UDP, TLS, or TCP. - """ - - username: str - """ - The SIP username used to authenticate with the external SIP peer for - registrations and outbound calls. Must start with a letter or number and contain - only letters, numbers, hyphens, and underscores. - """ diff --git a/src/telnyx/types/uac_inbound.py b/src/telnyx/types/uac_inbound.py deleted file mode 100644 index 8266455b..00000000 --- a/src/telnyx/types/uac_inbound.py +++ /dev/null @@ -1,76 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["UacInbound"] - - -class UacInbound(BaseModel): - ani_number_format: Optional[Literal["+E.164", "E.164", "+E.164-national", "E.164-national"]] = None - """ - This setting allows you to set the format with which the caller's number (ANI) - is sent for inbound phone calls. - """ - - channel_limit: Optional[int] = None - """ - When set, this will limit the total number of inbound calls to phone numbers - associated with this connection. - """ - - codecs: Optional[List[str]] = None - """ - Defines the list of codecs that Telnyx will send for inbound calls to a specific - number on your portal account, in priority order. This only works when the - Connection the number is assigned to uses Media Handling mode: default. OPUS and - H.264 codecs are available only when using TCP or TLS transport for SIP. - """ - - default_routing_method: Optional[Literal["sequential", "round-robin"]] = None - """ - Default routing method to be used when a number is associated with the - connection. Must be one of the routing method types or left blank, other values - are not allowed. - """ - - dnis_number_format: Optional[Literal["+e164", "e164", "national", "sip_username"]] = None - - generate_ringback_tone: Optional[bool] = None - """Generate ringback tone through 183 session progress message with early media.""" - - isup_headers_enabled: Optional[bool] = None - """When set, inbound phone calls will receive ISUP parameters via SIP headers. - - (Only when available and only when using TCP or TLS transport.) - """ - - prack_enabled: Optional[bool] = None - """Enable PRACK messages as defined in RFC3262.""" - - shaken_stir_enabled: Optional[bool] = None - """ - When enabled the SIP Connection will receive the Identity header with - Shaken/Stir data in the SIP INVITE message of inbound calls, even when using UDP - transport. - """ - - simultaneous_ringing: Optional[Literal["disabled", "enabled"]] = None - """When enabled, allows multiple devices to ring simultaneously on incoming calls.""" - - sip_compact_headers_enabled: Optional[bool] = None - """Defaults to true.""" - - sip_subdomain: Optional[str] = None - """The Telnyx-generated SIP subdomain for this UAC connection.""" - - sip_subdomain_receive_settings: Optional[Literal["only_my_connections", "from_anyone"]] = None - """Controls which SIP URI callers may reach this connection.""" - - timeout_1xx_secs: Optional[int] = None - """Time(sec) before aborting if connection is not made.""" - - timeout_2xx_secs: Optional[int] = None - """Time(sec) before aborting if call is unanswered (min: 1, max: 600).""" diff --git a/src/telnyx/types/uac_internal_settings.py b/src/telnyx/types/uac_internal_settings.py deleted file mode 100644 index 799d1494..00000000 --- a/src/telnyx/types/uac_internal_settings.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["UacInternalSettings"] - - -class UacInternalSettings(BaseModel): - """Internal Telnyx-side settings for a UAC connection.""" - - destination_uri: Optional[str] = None - """ - The SIP URI that Telnyx will call when handling an inbound request from the - external peer. Do not include a `sip:` prefix. The value must be in the format - `userinfo@sip.telnyx.com` or - `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only - letters, digits, hyphens, and underscores. - """ diff --git a/src/telnyx/types/uac_internal_settings_param.py b/src/telnyx/types/uac_internal_settings_param.py deleted file mode 100644 index 68ab4289..00000000 --- a/src/telnyx/types/uac_internal_settings_param.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["UacInternalSettingsParam"] - - -class UacInternalSettingsParam(TypedDict, total=False): - """Internal Telnyx-side settings for a UAC connection.""" - - destination_uri: str - """ - The SIP URI that Telnyx will call when handling an inbound request from the - external peer. Do not include a `sip:` prefix. The value must be in the format - `userinfo@sip.telnyx.com` or - `userinfo@sipdev.telnyx.com`; the userinfo portion may contain only - letters, digits, hyphens, and underscores. - """ diff --git a/src/telnyx/types/uac_outbound.py b/src/telnyx/types/uac_outbound.py deleted file mode 100644 index 81dcae6d..00000000 --- a/src/telnyx/types/uac_outbound.py +++ /dev/null @@ -1,66 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["UacOutbound"] - - -class UacOutbound(BaseModel): - ani_override: Optional[str] = None - """ - Set a phone number as the ani_override value to override caller id number on - outbound calls. - """ - - ani_override_type: Optional[Literal["always", "normal", "emergency"]] = None - """Specifies when we apply your ani_override setting. - - Only applies when ani_override is not blank. - """ - - call_parking_enabled: Optional[bool] = None - """ - Forces all SIP calls originated on this connection to be "parked" instead of - "bridged" to the destination specified on the URI. Parked calls will return - ringback to the caller and will await for a Call Control command to define which - action will be taken next. - """ - - channel_limit: Optional[int] = None - """ - When set, this will limit the total number of outbound calls to phone numbers - associated with this connection. - """ - - generate_ringback_tone: Optional[bool] = None - """Generate ringback tone through 183 session progress message with early media.""" - - instant_ringback_enabled: Optional[bool] = None - """ - When set, ringback will not wait for indication before sending ringback tone to - calling party. - """ - - localization: Optional[str] = None - """ - A 2-character country code specifying the country whose national dialing rules - should be used. For example, if set to `US` then any US number can be dialed - without preprending +1 to the number. When left blank, Telnyx will try US and GB - dialing rules, in that order, by default. - """ - - outbound_voice_profile_id: Optional[str] = None - """Identifies the associated outbound voice profile.""" - - t38_reinvite_source: Optional[ - Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] - ] = None - """This setting only affects connections with Fax-type Outbound Voice Profiles. - - The setting dictates whether or not Telnyx sends a t.38 reinvite.

By - default, Telnyx will send the re-invite. If set to `customer`, the caller is - expected to send the t.38 reinvite. - """ diff --git a/src/telnyx/types/uac_outbound_param.py b/src/telnyx/types/uac_outbound_param.py deleted file mode 100644 index c170e350..00000000 --- a/src/telnyx/types/uac_outbound_param.py +++ /dev/null @@ -1,64 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Literal, TypedDict - -__all__ = ["UacOutboundParam"] - - -class UacOutboundParam(TypedDict, total=False): - ani_override: str - """ - Set a phone number as the ani_override value to override caller id number on - outbound calls. - """ - - ani_override_type: Literal["always", "normal", "emergency"] - """Specifies when we apply your ani_override setting. - - Only applies when ani_override is not blank. - """ - - call_parking_enabled: Optional[bool] - """ - Forces all SIP calls originated on this connection to be "parked" instead of - "bridged" to the destination specified on the URI. Parked calls will return - ringback to the caller and will await for a Call Control command to define which - action will be taken next. - """ - - channel_limit: int - """ - When set, this will limit the total number of outbound calls to phone numbers - associated with this connection. - """ - - generate_ringback_tone: bool - """Generate ringback tone through 183 session progress message with early media.""" - - instant_ringback_enabled: bool - """ - When set, ringback will not wait for indication before sending ringback tone to - calling party. - """ - - localization: str - """ - A 2-character country code specifying the country whose national dialing rules - should be used. For example, if set to `US` then any US number can be dialed - without preprending +1 to the number. When left blank, Telnyx will try US and GB - dialing rules, in that order, by default. - """ - - outbound_voice_profile_id: str - """Identifies the associated outbound voice profile.""" - - t38_reinvite_source: Literal["telnyx", "customer", "disabled", "passthru", "caller-passthru", "callee-passthru"] - """This setting only affects connections with Fax-type Outbound Voice Profiles. - - The setting dictates whether or not Telnyx sends a t.38 reinvite.

By - default, Telnyx will send the re-invite. If set to `customer`, the caller is - expected to send the t.38 reinvite. - """ diff --git a/src/telnyx/types/virtual_cross_connect_combined.py b/src/telnyx/types/virtual_cross_connect_combined.py deleted file mode 100644 index 595a3fb3..00000000 --- a/src/telnyx/types/virtual_cross_connect_combined.py +++ /dev/null @@ -1,84 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel -from .interface_status import InterfaceStatus - -__all__ = ["VirtualCrossConnectCombined", "Region"] - - -class Region(BaseModel): - code: Optional[str] = None - """Region code of the interface.""" - - name: Optional[str] = None - """Region name of the interface.""" - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - -class VirtualCrossConnectCombined(BaseModel): - id: Optional[str] = None - """Identifies the resource.""" - - bandwidth_mbps: Optional[float] = None - """ - The desired throughput in Megabits per Second (Mbps) for your Virtual Cross - Connect. - """ - - bgp_asn: Optional[float] = None - """The Border Gateway Protocol (BGP) Autonomous System Number (ASN).""" - - cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None - """ - The Virtual Private Cloud with which you would like to establish a cross - connect. - """ - - cloud_provider_region: Optional[str] = None - """The region where your Virtual Private Cloud hosts are located.""" - - created_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was created.""" - - name: Optional[str] = None - """A user specified name for the interface.""" - - network_id: Optional[str] = None - """The id of the network associated with the interface.""" - - primary_bgp_key: Optional[str] = None - """The authentication key for BGP peer configuration.""" - - primary_cloud_account_id: Optional[str] = None - """The identifier for your Virtual Private Cloud.""" - - primary_cloud_ip: Optional[str] = None - """The IP address assigned for your side of the Virtual Cross Connect.""" - - primary_enabled: Optional[bool] = None - """Indicates whether the primary circuit is enabled.""" - - primary_routing_announcement: Optional[bool] = None - """Whether""" - - primary_telnyx_ip: Optional[str] = None - """The IP address assigned to the Telnyx side of the Virtual Cross Connect.""" - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - region: Optional[Region] = None - - region_code: Optional[str] = None - """The region interface is deployed to.""" - - status: Optional[InterfaceStatus] = None - """The current status of the interface deployment.""" - - updated_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was updated.""" diff --git a/src/telnyx/types/virtual_cross_connect_create_response.py b/src/telnyx/types/virtual_cross_connect_create_response.py index 283ab4eb..31e99a85 100644 --- a/src/telnyx/types/virtual_cross_connect_create_response.py +++ b/src/telnyx/types/virtual_cross_connect_create_response.py @@ -1,12 +1,125 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal +from .record import Record from .._models import BaseModel -from .virtual_cross_connect_combined import VirtualCrossConnectCombined +from .network_interface import NetworkInterface -__all__ = ["VirtualCrossConnectCreateResponse"] +__all__ = ["VirtualCrossConnectCreateResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + region_code: str + """The region interface is deployed to.""" + + bandwidth_mbps: Optional[float] = None + """ + The desired throughput in Megabits per Second (Mbps) for your Virtual Cross + Connect.

The available bandwidths can be found using the + /virtual_cross_connect_regions endpoint. + """ + + bgp_asn: Optional[float] = None + """The Border Gateway Protocol (BGP) Autonomous System Number (ASN). + + If null, value will be assigned by Telnyx. + """ + + cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None + """ + The Virtual Private Cloud with which you would like to establish a cross + connect. + """ + + cloud_provider_region: Optional[str] = None + """ + The region where your Virtual Private Cloud hosts are located.

The + available regions can be found using the /virtual_cross_connect_regions + endpoint. + """ + + primary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + primary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider. + """ + + primary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + primary_enabled: Optional[bool] = None + """Indicates whether the primary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + primary_routing_announcement: Optional[bool] = None + """Whether the primary BGP route is being announced.""" + + primary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ + + region: Optional[DataRegion] = None + + secondary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + secondary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider.

This + attribute is only necessary for GCE. + """ + + secondary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + secondary_enabled: Optional[bool] = None + """Indicates whether the secondary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + secondary_routing_announcement: Optional[bool] = None + """Whether the secondary BGP route is being announced.""" + + secondary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ class VirtualCrossConnectCreateResponse(BaseModel): - data: Optional[VirtualCrossConnectCombined] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/virtual_cross_connect_delete_response.py b/src/telnyx/types/virtual_cross_connect_delete_response.py index 44177acf..3ade9098 100644 --- a/src/telnyx/types/virtual_cross_connect_delete_response.py +++ b/src/telnyx/types/virtual_cross_connect_delete_response.py @@ -1,12 +1,125 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal +from .record import Record from .._models import BaseModel -from .virtual_cross_connect_combined import VirtualCrossConnectCombined +from .network_interface import NetworkInterface -__all__ = ["VirtualCrossConnectDeleteResponse"] +__all__ = ["VirtualCrossConnectDeleteResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + region_code: str + """The region interface is deployed to.""" + + bandwidth_mbps: Optional[float] = None + """ + The desired throughput in Megabits per Second (Mbps) for your Virtual Cross + Connect.

The available bandwidths can be found using the + /virtual_cross_connect_regions endpoint. + """ + + bgp_asn: Optional[float] = None + """The Border Gateway Protocol (BGP) Autonomous System Number (ASN). + + If null, value will be assigned by Telnyx. + """ + + cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None + """ + The Virtual Private Cloud with which you would like to establish a cross + connect. + """ + + cloud_provider_region: Optional[str] = None + """ + The region where your Virtual Private Cloud hosts are located.

The + available regions can be found using the /virtual_cross_connect_regions + endpoint. + """ + + primary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + primary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider. + """ + + primary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + primary_enabled: Optional[bool] = None + """Indicates whether the primary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + primary_routing_announcement: Optional[bool] = None + """Whether the primary BGP route is being announced.""" + + primary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ + + region: Optional[DataRegion] = None + + secondary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + secondary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider.

This + attribute is only necessary for GCE. + """ + + secondary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + secondary_enabled: Optional[bool] = None + """Indicates whether the secondary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + secondary_routing_announcement: Optional[bool] = None + """Whether the secondary BGP route is being announced.""" + + secondary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ class VirtualCrossConnectDeleteResponse(BaseModel): - data: Optional[VirtualCrossConnectCombined] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/virtual_cross_connect_list_response.py b/src/telnyx/types/virtual_cross_connect_list_response.py new file mode 100644 index 00000000..68688e1b --- /dev/null +++ b/src/telnyx/types/virtual_cross_connect_list_response.py @@ -0,0 +1,121 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .record import Record +from .._models import BaseModel +from .network_interface import NetworkInterface + +__all__ = ["VirtualCrossConnectListResponse", "VirtualCrossConnectListResponseRegion"] + + +class VirtualCrossConnectListResponseRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class VirtualCrossConnectListResponse(Record, NetworkInterface): + region_code: str + """The region interface is deployed to.""" + + bandwidth_mbps: Optional[float] = None + """ + The desired throughput in Megabits per Second (Mbps) for your Virtual Cross + Connect.

The available bandwidths can be found using the + /virtual_cross_connect_regions endpoint. + """ + + bgp_asn: Optional[float] = None + """The Border Gateway Protocol (BGP) Autonomous System Number (ASN). + + If null, value will be assigned by Telnyx. + """ + + cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None + """ + The Virtual Private Cloud with which you would like to establish a cross + connect. + """ + + cloud_provider_region: Optional[str] = None + """ + The region where your Virtual Private Cloud hosts are located.

The + available regions can be found using the /virtual_cross_connect_regions + endpoint. + """ + + primary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + primary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider. + """ + + primary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + primary_enabled: Optional[bool] = None + """Indicates whether the primary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + primary_routing_announcement: Optional[bool] = None + """Whether the primary BGP route is being announced.""" + + primary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ + + region: Optional[VirtualCrossConnectListResponseRegion] = None + + secondary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + secondary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider.

This + attribute is only necessary for GCE. + """ + + secondary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + secondary_enabled: Optional[bool] = None + """Indicates whether the secondary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + secondary_routing_announcement: Optional[bool] = None + """Whether the secondary BGP route is being announced.""" + + secondary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ diff --git a/src/telnyx/types/virtual_cross_connect_retrieve_response.py b/src/telnyx/types/virtual_cross_connect_retrieve_response.py index 7a327afa..913747e3 100644 --- a/src/telnyx/types/virtual_cross_connect_retrieve_response.py +++ b/src/telnyx/types/virtual_cross_connect_retrieve_response.py @@ -1,12 +1,125 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal +from .record import Record from .._models import BaseModel -from .virtual_cross_connect_combined import VirtualCrossConnectCombined +from .network_interface import NetworkInterface -__all__ = ["VirtualCrossConnectRetrieveResponse"] +__all__ = ["VirtualCrossConnectRetrieveResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + region_code: str + """The region interface is deployed to.""" + + bandwidth_mbps: Optional[float] = None + """ + The desired throughput in Megabits per Second (Mbps) for your Virtual Cross + Connect.

The available bandwidths can be found using the + /virtual_cross_connect_regions endpoint. + """ + + bgp_asn: Optional[float] = None + """The Border Gateway Protocol (BGP) Autonomous System Number (ASN). + + If null, value will be assigned by Telnyx. + """ + + cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None + """ + The Virtual Private Cloud with which you would like to establish a cross + connect. + """ + + cloud_provider_region: Optional[str] = None + """ + The region where your Virtual Private Cloud hosts are located.

The + available regions can be found using the /virtual_cross_connect_regions + endpoint. + """ + + primary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + primary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider. + """ + + primary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + primary_enabled: Optional[bool] = None + """Indicates whether the primary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + primary_routing_announcement: Optional[bool] = None + """Whether the primary BGP route is being announced.""" + + primary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ + + region: Optional[DataRegion] = None + + secondary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + secondary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider.

This + attribute is only necessary for GCE. + """ + + secondary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + secondary_enabled: Optional[bool] = None + """Indicates whether the secondary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + secondary_routing_announcement: Optional[bool] = None + """Whether the secondary BGP route is being announced.""" + + secondary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ class VirtualCrossConnectRetrieveResponse(BaseModel): - data: Optional[VirtualCrossConnectCombined] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/virtual_cross_connect_update_response.py b/src/telnyx/types/virtual_cross_connect_update_response.py index 63532bf5..de0085e4 100644 --- a/src/telnyx/types/virtual_cross_connect_update_response.py +++ b/src/telnyx/types/virtual_cross_connect_update_response.py @@ -1,12 +1,125 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal +from .record import Record from .._models import BaseModel -from .virtual_cross_connect_combined import VirtualCrossConnectCombined +from .network_interface import NetworkInterface -__all__ = ["VirtualCrossConnectUpdateResponse"] +__all__ = ["VirtualCrossConnectUpdateResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + region_code: str + """The region interface is deployed to.""" + + bandwidth_mbps: Optional[float] = None + """ + The desired throughput in Megabits per Second (Mbps) for your Virtual Cross + Connect.

The available bandwidths can be found using the + /virtual_cross_connect_regions endpoint. + """ + + bgp_asn: Optional[float] = None + """The Border Gateway Protocol (BGP) Autonomous System Number (ASN). + + If null, value will be assigned by Telnyx. + """ + + cloud_provider: Optional[Literal["aws", "azure", "gce"]] = None + """ + The Virtual Private Cloud with which you would like to establish a cross + connect. + """ + + cloud_provider_region: Optional[str] = None + """ + The region where your Virtual Private Cloud hosts are located.

The + available regions can be found using the /virtual_cross_connect_regions + endpoint. + """ + + primary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + primary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider. + """ + + primary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + primary_enabled: Optional[bool] = None + """Indicates whether the primary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + primary_routing_announcement: Optional[bool] = None + """Whether the primary BGP route is being announced.""" + + primary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ + + region: Optional[DataRegion] = None + + secondary_bgp_key: Optional[str] = None + """The authentication key for BGP peer configuration.""" + + secondary_cloud_account_id: Optional[str] = None + """The identifier for your Virtual Private Cloud. + + The number will be different based upon your Cloud provider.

This + attribute is only necessary for GCE. + """ + + secondary_cloud_ip: Optional[str] = None + """ + The IP address assigned for your side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value can not be patched once the VXC has bene provisioned. + """ + + secondary_enabled: Optional[bool] = None + """Indicates whether the secondary circuit is enabled. + + Setting this to `false` will disable the circuit. + """ + + secondary_routing_announcement: Optional[bool] = None + """Whether the secondary BGP route is being announced.""" + + secondary_telnyx_ip: Optional[str] = None + """ + The IP address assigned to the Telnyx side of the Virtual Cross + Connect.

If none is provided, one will be generated for + you.

This value should be null for GCE as Google will only inform you + of your assigned IP once the connection has been accepted. + """ class VirtualCrossConnectUpdateResponse(BaseModel): - data: Optional[VirtualCrossConnectCombined] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/wireguard_interface_create_response.py b/src/telnyx/types/wireguard_interface_create_response.py index 73f8bd7f..458ea75d 100644 --- a/src/telnyx/types/wireguard_interface_create_response.py +++ b/src/telnyx/types/wireguard_interface_create_response.py @@ -2,11 +2,39 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .wireguard_interface_read import WireguardInterfaceRead +from .network_interface import NetworkInterface -__all__ = ["WireguardInterfaceCreateResponse"] +__all__ = ["WireguardInterfaceCreateResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + enable_sip_trunking: Optional[bool] = None + """Enable SIP traffic forwarding over VPN interface.""" + + endpoint: Optional[str] = None + """The Telnyx WireGuard peers `Peer.endpoint` value.""" + + public_key: Optional[str] = None + """The Telnyx WireGuard peers `Peer.PublicKey`.""" + + region: Optional[DataRegion] = None + + region_code: Optional[str] = None + """The region interface is deployed to.""" class WireguardInterfaceCreateResponse(BaseModel): - data: Optional[WireguardInterfaceRead] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/wireguard_interface_delete_response.py b/src/telnyx/types/wireguard_interface_delete_response.py index d6638859..519a9b74 100644 --- a/src/telnyx/types/wireguard_interface_delete_response.py +++ b/src/telnyx/types/wireguard_interface_delete_response.py @@ -2,11 +2,39 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .wireguard_interface_read import WireguardInterfaceRead +from .network_interface import NetworkInterface -__all__ = ["WireguardInterfaceDeleteResponse"] +__all__ = ["WireguardInterfaceDeleteResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + enable_sip_trunking: Optional[bool] = None + """Enable SIP traffic forwarding over VPN interface.""" + + endpoint: Optional[str] = None + """The Telnyx WireGuard peers `Peer.endpoint` value.""" + + public_key: Optional[str] = None + """The Telnyx WireGuard peers `Peer.PublicKey`.""" + + region: Optional[DataRegion] = None + + region_code: Optional[str] = None + """The region interface is deployed to.""" class WireguardInterfaceDeleteResponse(BaseModel): - data: Optional[WireguardInterfaceRead] = None + data: Optional[Data] = None diff --git a/src/telnyx/types/wireguard_interface_list_response.py b/src/telnyx/types/wireguard_interface_list_response.py new file mode 100644 index 00000000..77fb1d5d --- /dev/null +++ b/src/telnyx/types/wireguard_interface_list_response.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .record import Record +from .._models import BaseModel +from .network_interface import NetworkInterface + +__all__ = ["WireguardInterfaceListResponse", "WireguardInterfaceListResponseRegion"] + + +class WireguardInterfaceListResponseRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class WireguardInterfaceListResponse(Record, NetworkInterface): + enable_sip_trunking: Optional[bool] = None + """Enable SIP traffic forwarding over VPN interface.""" + + endpoint: Optional[str] = None + """The Telnyx WireGuard peers `Peer.endpoint` value.""" + + public_key: Optional[str] = None + """The Telnyx WireGuard peers `Peer.PublicKey`.""" + + region: Optional[WireguardInterfaceListResponseRegion] = None + + region_code: Optional[str] = None + """The region interface is deployed to.""" diff --git a/src/telnyx/types/wireguard_interface_read.py b/src/telnyx/types/wireguard_interface_read.py deleted file mode 100644 index 424ffc20..00000000 --- a/src/telnyx/types/wireguard_interface_read.py +++ /dev/null @@ -1,56 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel -from .interface_status import InterfaceStatus - -__all__ = ["WireguardInterfaceRead", "Region"] - - -class Region(BaseModel): - code: Optional[str] = None - """Region code of the interface.""" - - name: Optional[str] = None - """Region name of the interface.""" - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - -class WireguardInterfaceRead(BaseModel): - id: Optional[str] = None - """Identifies the resource.""" - - created_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was created.""" - - enable_sip_trunking: Optional[bool] = None - """Enable SIP traffic forwarding over VPN interface.""" - - endpoint: Optional[str] = None - """The Telnyx WireGuard peers `Peer.endpoint` value.""" - - name: Optional[str] = None - """A user specified name for the interface.""" - - network_id: Optional[str] = None - """The id of the network associated with the interface.""" - - public_key: Optional[str] = None - """The Telnyx WireGuard peers `Peer.PublicKey`.""" - - record_type: Optional[str] = None - """Identifies the type of the resource.""" - - region: Optional[Region] = None - - region_code: Optional[str] = None - """The region interface is deployed to.""" - - status: Optional[InterfaceStatus] = None - """The current status of the interface deployment.""" - - updated_at: Optional[str] = None - """ISO 8601 formatted date-time indicating when the resource was updated.""" diff --git a/src/telnyx/types/wireguard_interface_retrieve_response.py b/src/telnyx/types/wireguard_interface_retrieve_response.py index d4dced88..9816c28f 100644 --- a/src/telnyx/types/wireguard_interface_retrieve_response.py +++ b/src/telnyx/types/wireguard_interface_retrieve_response.py @@ -2,11 +2,39 @@ from typing import Optional +from .record import Record from .._models import BaseModel -from .wireguard_interface_read import WireguardInterfaceRead +from .network_interface import NetworkInterface -__all__ = ["WireguardInterfaceRetrieveResponse"] +__all__ = ["WireguardInterfaceRetrieveResponse", "Data", "DataRegion"] + + +class DataRegion(BaseModel): + code: Optional[str] = None + """Region code of the interface.""" + + name: Optional[str] = None + """Region name of the interface.""" + + record_type: Optional[str] = None + """Identifies the type of the resource.""" + + +class Data(Record, NetworkInterface): + enable_sip_trunking: Optional[bool] = None + """Enable SIP traffic forwarding over VPN interface.""" + + endpoint: Optional[str] = None + """The Telnyx WireGuard peers `Peer.endpoint` value.""" + + public_key: Optional[str] = None + """The Telnyx WireGuard peers `Peer.PublicKey`.""" + + region: Optional[DataRegion] = None + + region_code: Optional[str] = None + """The region interface is deployed to.""" class WireguardInterfaceRetrieveResponse(BaseModel): - data: Optional[WireguardInterfaceRead] = None + data: Optional[Data] = None diff --git a/tests/api_resources/calls/test_actions.py b/tests/api_resources/calls/test_actions.py index 385ba3de..4ca56c60 100644 --- a/tests/api_resources/calls/test_actions.py +++ b/tests/api_resources/calls/test_actions.py @@ -47,7 +47,9 @@ ActionStopNoiseSuppressionResponse, ActionSwitchSupervisorRoleResponse, ActionStartNoiseSuppressionResponse, + ActionStopConversationRelayResponse, ActionAddAIAssistantMessagesResponse, + ActionStartConversationRelayResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -1492,6 +1494,109 @@ def test_path_params_start_ai_assistant(self, client: Telnyx) -> None: call_control_id="", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_start_conversation_relay(self, client: Telnyx) -> None: + action = client.calls.actions.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_start_conversation_relay_with_all_params(self, client: Telnyx) -> None: + action = client.calls.actions.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + assistant={ + "dynamic_variables": { + "customer_id": "12345", + "tier": "premium", + } + }, + client_state="aGF2ZSBhIG5pY2UgZGF5ID1d", + command_id="891510ac-f3e4-11e8-af5b-de00688a4901", + conversation_relay_dtmf_detection=True, + greeting="Hi! Ask me anything!", + interruption_settings={ + "enable": True, + "interruptible": "speech", + "interruptible_greeting": "speech", + "welcome_greeting_interruptible": "speech", + }, + language="en-US", + languages=[ + { + "code": "en-US", + "speech_model": "nova-2", + "transcription_provider": "Deepgram", + "tts_provider": "ElevenLabs", + "voice": "alice", + } + ], + participants=[ + { + "id": "v3:abc123def456", + "role": "user", + "name": "John Doe", + "on_hangup": "continue_conversation", + } + ], + send_message_history_updates=True, + transcription={ + "language": "en-US", + "model": "nova-2", + "provider": "deepgram", + }, + transcription_language="en-US", + tts_language="es", + user_response_timeout_ms=10000, + voice="Telnyx.KokoroTTS.af", + voice_settings={ + "type": "elevenlabs", + "api_key_ref": "my_elevenlabs_api_key", + }, + ) + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_start_conversation_relay(self, client: Telnyx) -> None: + response = client.calls.actions.with_raw_response.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + action = response.parse() + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_start_conversation_relay(self, client: Telnyx) -> None: + with client.calls.actions.with_streaming_response.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + action = response.parse() + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_start_conversation_relay(self, client: Telnyx) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `call_control_id` but received ''"): + client.calls.actions.with_raw_response.start_conversation_relay( + call_control_id="", + conversation_relay_url="wss://example.com/conversation-relay", + ) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_start_forking(self, client: Telnyx) -> None: @@ -2003,6 +2108,58 @@ def test_path_params_stop_ai_assistant(self, client: Telnyx) -> None: call_control_id="", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_stop_conversation_relay(self, client: Telnyx) -> None: + action = client.calls.actions.stop_conversation_relay( + call_control_id="call_control_id", + ) + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_stop_conversation_relay_with_all_params(self, client: Telnyx) -> None: + action = client.calls.actions.stop_conversation_relay( + call_control_id="call_control_id", + client_state="aGF2ZSBhIG5pY2UgZGF5ID1d", + command_id="891510ac-f3e4-11e8-af5b-de00688a4901", + ) + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_stop_conversation_relay(self, client: Telnyx) -> None: + response = client.calls.actions.with_raw_response.stop_conversation_relay( + call_control_id="call_control_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + action = response.parse() + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_stop_conversation_relay(self, client: Telnyx) -> None: + with client.calls.actions.with_streaming_response.stop_conversation_relay( + call_control_id="call_control_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + action = response.parse() + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_stop_conversation_relay(self, client: Telnyx) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `call_control_id` but received ''"): + client.calls.actions.with_raw_response.stop_conversation_relay( + call_control_id="", + ) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stop_forking(self, client: Telnyx) -> None: @@ -4083,6 +4240,109 @@ async def test_path_params_start_ai_assistant(self, async_client: AsyncTelnyx) - call_control_id="", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_start_conversation_relay(self, async_client: AsyncTelnyx) -> None: + action = await async_client.calls.actions.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_start_conversation_relay_with_all_params(self, async_client: AsyncTelnyx) -> None: + action = await async_client.calls.actions.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + assistant={ + "dynamic_variables": { + "customer_id": "12345", + "tier": "premium", + } + }, + client_state="aGF2ZSBhIG5pY2UgZGF5ID1d", + command_id="891510ac-f3e4-11e8-af5b-de00688a4901", + conversation_relay_dtmf_detection=True, + greeting="Hi! Ask me anything!", + interruption_settings={ + "enable": True, + "interruptible": "speech", + "interruptible_greeting": "speech", + "welcome_greeting_interruptible": "speech", + }, + language="en-US", + languages=[ + { + "code": "en-US", + "speech_model": "nova-2", + "transcription_provider": "Deepgram", + "tts_provider": "ElevenLabs", + "voice": "alice", + } + ], + participants=[ + { + "id": "v3:abc123def456", + "role": "user", + "name": "John Doe", + "on_hangup": "continue_conversation", + } + ], + send_message_history_updates=True, + transcription={ + "language": "en-US", + "model": "nova-2", + "provider": "deepgram", + }, + transcription_language="en-US", + tts_language="es", + user_response_timeout_ms=10000, + voice="Telnyx.KokoroTTS.af", + voice_settings={ + "type": "elevenlabs", + "api_key_ref": "my_elevenlabs_api_key", + }, + ) + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_start_conversation_relay(self, async_client: AsyncTelnyx) -> None: + response = await async_client.calls.actions.with_raw_response.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + action = await response.parse() + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_start_conversation_relay(self, async_client: AsyncTelnyx) -> None: + async with async_client.calls.actions.with_streaming_response.start_conversation_relay( + call_control_id="call_control_id", + conversation_relay_url="wss://example.com/conversation-relay", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + action = await response.parse() + assert_matches_type(ActionStartConversationRelayResponse, action, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_start_conversation_relay(self, async_client: AsyncTelnyx) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `call_control_id` but received ''"): + await async_client.calls.actions.with_raw_response.start_conversation_relay( + call_control_id="", + conversation_relay_url="wss://example.com/conversation-relay", + ) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_start_forking(self, async_client: AsyncTelnyx) -> None: @@ -4594,6 +4854,58 @@ async def test_path_params_stop_ai_assistant(self, async_client: AsyncTelnyx) -> call_control_id="", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_stop_conversation_relay(self, async_client: AsyncTelnyx) -> None: + action = await async_client.calls.actions.stop_conversation_relay( + call_control_id="call_control_id", + ) + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_stop_conversation_relay_with_all_params(self, async_client: AsyncTelnyx) -> None: + action = await async_client.calls.actions.stop_conversation_relay( + call_control_id="call_control_id", + client_state="aGF2ZSBhIG5pY2UgZGF5ID1d", + command_id="891510ac-f3e4-11e8-af5b-de00688a4901", + ) + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_stop_conversation_relay(self, async_client: AsyncTelnyx) -> None: + response = await async_client.calls.actions.with_raw_response.stop_conversation_relay( + call_control_id="call_control_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + action = await response.parse() + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_stop_conversation_relay(self, async_client: AsyncTelnyx) -> None: + async with async_client.calls.actions.with_streaming_response.stop_conversation_relay( + call_control_id="call_control_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + action = await response.parse() + assert_matches_type(ActionStopConversationRelayResponse, action, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_stop_conversation_relay(self, async_client: AsyncTelnyx) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `call_control_id` but received ''"): + await async_client.calls.actions.with_raw_response.stop_conversation_relay( + call_control_id="", + ) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stop_forking(self, async_client: AsyncTelnyx) -> None: diff --git a/tests/api_resources/test_public_internet_gateways.py b/tests/api_resources/test_public_internet_gateways.py index 821b3803..14e4cf46 100644 --- a/tests/api_resources/test_public_internet_gateways.py +++ b/tests/api_resources/test_public_internet_gateways.py @@ -10,7 +10,7 @@ from telnyx import Telnyx, AsyncTelnyx from tests.utils import assert_matches_type from telnyx.types import ( - PublicInternetGatewayRead, + PublicInternetGatewayListResponse, PublicInternetGatewayCreateResponse, PublicInternetGatewayDeleteResponse, PublicInternetGatewayRetrieveResponse, @@ -108,7 +108,7 @@ def test_path_params_retrieve(self, client: Telnyx) -> None: def test_method_list(self, client: Telnyx) -> None: public_internet_gateway = client.public_internet_gateways.list() assert_matches_type( - SyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + SyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -120,7 +120,7 @@ def test_method_list_with_all_params(self, client: Telnyx) -> None: page_size=0, ) assert_matches_type( - SyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + SyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -132,7 +132,7 @@ def test_raw_response_list(self, client: Telnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" public_internet_gateway = response.parse() assert_matches_type( - SyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + SyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -144,7 +144,7 @@ def test_streaming_response_list(self, client: Telnyx) -> None: public_internet_gateway = response.parse() assert_matches_type( - SyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + SyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -282,7 +282,7 @@ async def test_path_params_retrieve(self, async_client: AsyncTelnyx) -> None: async def test_method_list(self, async_client: AsyncTelnyx) -> None: public_internet_gateway = await async_client.public_internet_gateways.list() assert_matches_type( - AsyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + AsyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -294,7 +294,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncTelnyx) -> N page_size=0, ) assert_matches_type( - AsyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + AsyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -306,7 +306,7 @@ async def test_raw_response_list(self, async_client: AsyncTelnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" public_internet_gateway = await response.parse() assert_matches_type( - AsyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + AsyncDefaultFlatPagination[PublicInternetGatewayListResponse], public_internet_gateway, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -318,7 +318,9 @@ async def test_streaming_response_list(self, async_client: AsyncTelnyx) -> None: public_internet_gateway = await response.parse() assert_matches_type( - AsyncDefaultFlatPagination[PublicInternetGatewayRead], public_internet_gateway, path=["response"] + AsyncDefaultFlatPagination[PublicInternetGatewayListResponse], + public_internet_gateway, + path=["response"], ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_uac_connections.py b/tests/api_resources/test_uac_connections.py index 6fe9f2df..b50af293 100644 --- a/tests/api_resources/test_uac_connections.py +++ b/tests/api_resources/test_uac_connections.py @@ -10,7 +10,7 @@ from telnyx import Telnyx, AsyncTelnyx from tests.utils import assert_matches_type from telnyx.types import ( - UacConnection, + UacConnectionListResponse, UacConnectionCreateResponse, UacConnectionDeleteResponse, UacConnectionUpdateResponse, @@ -303,7 +303,7 @@ def test_path_params_update(self, client: Telnyx) -> None: @parametrize def test_method_list(self, client: Telnyx) -> None: uac_connection = client.uac_connections.list() - assert_matches_type(SyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(SyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -318,7 +318,7 @@ def test_method_list_with_all_params(self, client: Telnyx) -> None: page_size=0, sort="connection_name", ) - assert_matches_type(SyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(SyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -328,7 +328,7 @@ def test_raw_response_list(self, client: Telnyx) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" uac_connection = response.parse() - assert_matches_type(SyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(SyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -338,7 +338,7 @@ def test_streaming_response_list(self, client: Telnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" uac_connection = response.parse() - assert_matches_type(SyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(SyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -669,7 +669,7 @@ async def test_path_params_update(self, async_client: AsyncTelnyx) -> None: @parametrize async def test_method_list(self, async_client: AsyncTelnyx) -> None: uac_connection = await async_client.uac_connections.list() - assert_matches_type(AsyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(AsyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -684,7 +684,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncTelnyx) -> N page_size=0, sort="connection_name", ) - assert_matches_type(AsyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(AsyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -694,7 +694,7 @@ async def test_raw_response_list(self, async_client: AsyncTelnyx) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" uac_connection = await response.parse() - assert_matches_type(AsyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type(AsyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -704,7 +704,9 @@ async def test_streaming_response_list(self, async_client: AsyncTelnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" uac_connection = await response.parse() - assert_matches_type(AsyncDefaultFlatPagination[UacConnection], uac_connection, path=["response"]) + assert_matches_type( + AsyncDefaultFlatPagination[UacConnectionListResponse], uac_connection, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_virtual_cross_connects.py b/tests/api_resources/test_virtual_cross_connects.py index 7b7e2cb1..e44f183c 100644 --- a/tests/api_resources/test_virtual_cross_connects.py +++ b/tests/api_resources/test_virtual_cross_connects.py @@ -10,7 +10,7 @@ from telnyx import Telnyx, AsyncTelnyx from tests.utils import assert_matches_type from telnyx.types import ( - VirtualCrossConnectCombined, + VirtualCrossConnectListResponse, VirtualCrossConnectCreateResponse, VirtualCrossConnectDeleteResponse, VirtualCrossConnectUpdateResponse, @@ -183,7 +183,7 @@ def test_path_params_update(self, client: Telnyx) -> None: def test_method_list(self, client: Telnyx) -> None: virtual_cross_connect = client.virtual_cross_connects.list() assert_matches_type( - SyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + SyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -195,7 +195,7 @@ def test_method_list_with_all_params(self, client: Telnyx) -> None: page_size=0, ) assert_matches_type( - SyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + SyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -207,7 +207,7 @@ def test_raw_response_list(self, client: Telnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" virtual_cross_connect = response.parse() assert_matches_type( - SyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + SyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -219,7 +219,7 @@ def test_streaming_response_list(self, client: Telnyx) -> None: virtual_cross_connect = response.parse() assert_matches_type( - SyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + SyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -431,7 +431,7 @@ async def test_path_params_update(self, async_client: AsyncTelnyx) -> None: async def test_method_list(self, async_client: AsyncTelnyx) -> None: virtual_cross_connect = await async_client.virtual_cross_connects.list() assert_matches_type( - AsyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + AsyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -443,7 +443,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncTelnyx) -> N page_size=0, ) assert_matches_type( - AsyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + AsyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -455,7 +455,7 @@ async def test_raw_response_list(self, async_client: AsyncTelnyx) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" virtual_cross_connect = await response.parse() assert_matches_type( - AsyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + AsyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -467,7 +467,7 @@ async def test_streaming_response_list(self, async_client: AsyncTelnyx) -> None: virtual_cross_connect = await response.parse() assert_matches_type( - AsyncDefaultFlatPagination[VirtualCrossConnectCombined], virtual_cross_connect, path=["response"] + AsyncDefaultFlatPagination[VirtualCrossConnectListResponse], virtual_cross_connect, path=["response"] ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_wireguard_interfaces.py b/tests/api_resources/test_wireguard_interfaces.py index 88924f8c..8627060c 100644 --- a/tests/api_resources/test_wireguard_interfaces.py +++ b/tests/api_resources/test_wireguard_interfaces.py @@ -10,7 +10,7 @@ from telnyx import Telnyx, AsyncTelnyx from tests.utils import assert_matches_type from telnyx.types import ( - WireguardInterfaceRead, + WireguardInterfaceListResponse, WireguardInterfaceCreateResponse, WireguardInterfaceDeleteResponse, WireguardInterfaceRetrieveResponse, @@ -114,7 +114,9 @@ def test_path_params_retrieve(self, client: Telnyx) -> None: @parametrize def test_method_list(self, client: Telnyx) -> None: wireguard_interface = client.wireguard_interfaces.list() - assert_matches_type(SyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + SyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -124,7 +126,9 @@ def test_method_list_with_all_params(self, client: Telnyx) -> None: page_number=0, page_size=0, ) - assert_matches_type(SyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + SyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -134,7 +138,9 @@ def test_raw_response_list(self, client: Telnyx) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" wireguard_interface = response.parse() - assert_matches_type(SyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + SyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -145,7 +151,7 @@ def test_streaming_response_list(self, client: Telnyx) -> None: wireguard_interface = response.parse() assert_matches_type( - SyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"] + SyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -289,7 +295,9 @@ async def test_path_params_retrieve(self, async_client: AsyncTelnyx) -> None: @parametrize async def test_method_list(self, async_client: AsyncTelnyx) -> None: wireguard_interface = await async_client.wireguard_interfaces.list() - assert_matches_type(AsyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + AsyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -299,7 +307,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncTelnyx) -> N page_number=0, page_size=0, ) - assert_matches_type(AsyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + AsyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -309,7 +319,9 @@ async def test_raw_response_list(self, async_client: AsyncTelnyx) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" wireguard_interface = await response.parse() - assert_matches_type(AsyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"]) + assert_matches_type( + AsyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] + ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -320,7 +332,7 @@ async def test_streaming_response_list(self, async_client: AsyncTelnyx) -> None: wireguard_interface = await response.parse() assert_matches_type( - AsyncDefaultFlatPagination[WireguardInterfaceRead], wireguard_interface, path=["response"] + AsyncDefaultFlatPagination[WireguardInterfaceListResponse], wireguard_interface, path=["response"] ) assert cast(Any, response.is_closed) is True