telnyx 3.5.0a0__py3-none-any.whl → 3.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of telnyx might be problematic. Click here for more details.

Files changed (224) hide show
  1. telnyx/_client.py +56 -756
  2. telnyx/_version.py +1 -1
  3. telnyx/resources/__init__.py +70 -0
  4. telnyx/resources/advanced_orders.py +63 -63
  5. telnyx/resources/ai/assistants/assistants.py +15 -17
  6. telnyx/resources/ai/assistants/versions.py +13 -15
  7. telnyx/resources/ai/conversations/conversations.py +137 -3
  8. telnyx/resources/ai/conversations/messages.py +1 -134
  9. telnyx/resources/brand/brand.py +8 -4
  10. telnyx/resources/calls/actions.py +154 -150
  11. telnyx/resources/calls/calls.py +18 -10
  12. telnyx/resources/conferences/actions.py +8 -24
  13. telnyx/resources/conferences/conferences.py +2 -6
  14. telnyx/resources/documents.py +242 -37
  15. telnyx/resources/legacy/__init__.py +33 -0
  16. telnyx/resources/legacy/legacy.py +102 -0
  17. telnyx/resources/legacy/reporting/__init__.py +47 -0
  18. telnyx/resources/legacy/reporting/batch_detail_records/__init__.py +61 -0
  19. telnyx/resources/legacy/reporting/batch_detail_records/batch_detail_records.py +166 -0
  20. telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +482 -0
  21. telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
  22. telnyx/resources/legacy/reporting/batch_detail_records/voice.py +539 -0
  23. telnyx/resources/legacy/reporting/reporting.py +134 -0
  24. telnyx/resources/legacy/reporting/usage_reports/__init__.py +61 -0
  25. telnyx/resources/legacy/reporting/usage_reports/messaging.py +471 -0
  26. telnyx/resources/legacy/reporting/usage_reports/number_lookup.py +464 -0
  27. telnyx/resources/legacy/reporting/usage_reports/usage_reports.py +288 -0
  28. telnyx/resources/legacy/reporting/usage_reports/voice.py +493 -0
  29. telnyx/resources/messaging_profiles/messaging_profiles.py +16 -0
  30. telnyx/resources/messaging_tollfree/verification/requests.py +203 -1
  31. telnyx/resources/oauth.py +855 -0
  32. telnyx/resources/oauth_clients.py +711 -0
  33. telnyx/resources/oauth_grants.py +349 -0
  34. telnyx/resources/outbound_voice_profiles.py +24 -4
  35. telnyx/resources/phone_numbers/jobs.py +12 -0
  36. telnyx/resources/porting_orders/porting_orders.py +20 -8
  37. telnyx/resources/sim_cards/actions.py +12 -12
  38. telnyx/resources/sim_cards/sim_cards.py +3 -2
  39. telnyx/resources/texml/accounts/calls/calls.py +11 -0
  40. telnyx/resources/texml/accounts/conferences/participants.py +11 -0
  41. telnyx/resources/verifications/verifications.py +10 -0
  42. telnyx/resources/verified_numbers/verified_numbers.py +25 -4
  43. telnyx/resources/verify_profiles.py +182 -1
  44. telnyx/resources/well_known.py +198 -0
  45. telnyx/types/__init__.py +51 -9
  46. telnyx/types/access_ip_address_list_response.py +3 -12
  47. telnyx/types/access_ip_range_list_response.py +3 -12
  48. telnyx/types/addresses/action_validate_response.py +8 -3
  49. telnyx/types/{advanced_order_update_params.py → advanced_order_update_requirement_group_params.py} +2 -2
  50. telnyx/types/ai/__init__.py +2 -3
  51. telnyx/types/ai/assistant_import_params.py +1 -1
  52. telnyx/types/ai/assistants/__init__.py +0 -3
  53. telnyx/types/ai/assistants_list.py +4 -88
  54. telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
  55. telnyx/types/ai/conversations/__init__.py +0 -1
  56. telnyx/types/ai/import_metadata.py +1 -1
  57. telnyx/types/ai/{assistant_clone_response.py → inference_embedding.py} +2 -2
  58. telnyx/types/ai/inference_embedding_transfer_tool_params.py +6 -0
  59. telnyx/types/ai/inference_embedding_transfer_tool_params_param.py +6 -0
  60. telnyx/types/ai/inference_embedding_webhook_tool_params.py +2 -0
  61. telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +2 -0
  62. telnyx/types/ai/voice_settings.py +49 -2
  63. telnyx/types/ai/voice_settings_param.py +49 -2
  64. telnyx/types/brand_create_params.py +2 -1
  65. telnyx/types/brand_update_params.py +2 -1
  66. telnyx/types/call_dial_params.py +11 -3
  67. telnyx/types/calls/__init__.py +1 -0
  68. telnyx/types/calls/action_answer_params.py +1 -2
  69. telnyx/types/calls/action_gather_using_ai_params.py +5 -8
  70. telnyx/types/calls/action_start_streaming_params.py +5 -2
  71. telnyx/types/calls/action_start_transcription_params.py +160 -6
  72. telnyx/types/calls/action_transfer_params.py +50 -0
  73. telnyx/types/calls/telnyx_transcription_language.py +108 -0
  74. telnyx/types/calls/transcription_engine_b_config_param.py +3 -102
  75. telnyx/types/calls/transcription_start_request_param.py +161 -6
  76. telnyx/types/campaign_submit_appeal_response.py +0 -3
  77. telnyx/types/country_coverage_retrieve_country_response.py +7 -0
  78. telnyx/types/country_coverage_retrieve_response.py +7 -0
  79. telnyx/types/document_upload_json_params.py +39 -0
  80. telnyx/types/document_upload_json_response.py +12 -0
  81. telnyx/types/legacy/__init__.py +3 -0
  82. telnyx/types/legacy/reporting/__init__.py +12 -0
  83. telnyx/types/legacy/reporting/batch_detail_records/__init__.py +24 -0
  84. telnyx/types/legacy/reporting/batch_detail_records/batch_csv_pagination_meta.py +17 -0
  85. telnyx/types/legacy/reporting/batch_detail_records/cdr_detailed_req_response.py +63 -0
  86. telnyx/types/legacy/reporting/batch_detail_records/mdr_detail_report_response.py +42 -0
  87. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +55 -0
  88. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +12 -0
  89. telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +12 -0
  90. telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +15 -0
  91. telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +12 -0
  92. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_params.py +19 -0
  93. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +12 -0
  94. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +12 -0
  95. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +12 -0
  96. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +12 -0
  97. telnyx/types/legacy/reporting/batch_detail_records/stt_detail_report_response.py +27 -0
  98. telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +57 -0
  99. telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +13 -0
  100. telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +13 -0
  101. telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +15 -0
  102. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_fields_response.py +23 -0
  103. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +13 -0
  104. telnyx/types/legacy/reporting/filter.py +31 -0
  105. telnyx/types/legacy/reporting/filter_param.py +30 -0
  106. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_params.py +17 -0
  107. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_response.py +11 -0
  108. telnyx/types/legacy/reporting/usage_reports/__init__.py +21 -0
  109. telnyx/types/legacy/reporting/usage_reports/cdr_usage_report_response_legacy.py +43 -0
  110. telnyx/types/legacy/reporting/usage_reports/mdr_usage_report_response_legacy.py +38 -0
  111. telnyx/types/legacy/reporting/usage_reports/messaging_create_params.py +29 -0
  112. telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +13 -0
  113. telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +13 -0
  114. telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
  115. telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +15 -0
  116. telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +13 -0
  117. telnyx/types/legacy/reporting/usage_reports/number_lookup_create_params.py +26 -0
  118. telnyx/types/legacy/reporting/usage_reports/number_lookup_list_params.py +13 -0
  119. telnyx/types/legacy/reporting/usage_reports/standard_pagination_meta.py +17 -0
  120. telnyx/types/legacy/reporting/usage_reports/voice_create_params.py +40 -0
  121. telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +13 -0
  122. telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +13 -0
  123. telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
  124. telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +15 -0
  125. telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +13 -0
  126. telnyx/types/message_template.py +12 -0
  127. telnyx/types/messaging_profile.py +3 -0
  128. telnyx/types/messaging_profile_create_params.py +3 -0
  129. telnyx/types/messaging_profile_update_params.py +3 -0
  130. telnyx/types/messaging_tollfree/verification/__init__.py +1 -0
  131. telnyx/types/messaging_tollfree/verification/request_create_params.py +51 -1
  132. telnyx/types/messaging_tollfree/verification/request_update_params.py +51 -1
  133. telnyx/types/messaging_tollfree/verification/toll_free_verification_entity_type.py +9 -0
  134. telnyx/types/messaging_tollfree/verification/verification_request_egress.py +24 -0
  135. telnyx/types/messaging_tollfree/verification/verification_request_status.py +24 -0
  136. telnyx/types/number_order_status_update_webhook_event.py +30 -4
  137. telnyx/types/oauth_client.py +59 -0
  138. telnyx/types/oauth_client_create_params.py +39 -0
  139. telnyx/types/oauth_client_create_response.py +12 -0
  140. telnyx/types/oauth_client_list_params.py +38 -0
  141. telnyx/types/oauth_client_list_response.py +15 -0
  142. telnyx/types/oauth_client_retrieve_response.py +12 -0
  143. telnyx/types/oauth_client_update_params.py +36 -0
  144. telnyx/types/oauth_client_update_response.py +12 -0
  145. telnyx/types/oauth_grant.py +29 -0
  146. telnyx/types/oauth_grant_delete_response.py +12 -0
  147. telnyx/types/oauth_grant_list_params.py +17 -0
  148. telnyx/types/oauth_grant_list_response.py +15 -0
  149. telnyx/types/oauth_grant_retrieve_response.py +12 -0
  150. telnyx/types/oauth_grants_params.py +15 -0
  151. telnyx/types/oauth_grants_response.py +10 -0
  152. telnyx/types/oauth_introspect_params.py +12 -0
  153. telnyx/types/oauth_introspect_response.py +30 -0
  154. telnyx/types/oauth_register_params.py +39 -0
  155. telnyx/types/oauth_register_response.py +45 -0
  156. telnyx/types/oauth_retrieve_authorize_params.py +30 -0
  157. telnyx/types/oauth_retrieve_jwks_response.py +25 -0
  158. telnyx/types/oauth_retrieve_response.py +47 -0
  159. telnyx/types/oauth_token_params.py +33 -0
  160. telnyx/types/oauth_token_response.py +25 -0
  161. telnyx/types/outbound_voice_profile.py +27 -1
  162. telnyx/types/outbound_voice_profile_create_params.py +27 -1
  163. telnyx/types/outbound_voice_profile_list_params.py +1 -1
  164. telnyx/types/outbound_voice_profile_update_params.py +27 -1
  165. telnyx/types/pagination_meta_cloudflare_ip_list_sync.py +15 -0
  166. telnyx/types/pagination_meta_oauth.py +21 -0
  167. telnyx/types/phone_number_blocks/__init__.py +1 -0
  168. telnyx/types/phone_number_blocks/job.py +3 -34
  169. telnyx/types/phone_number_blocks/job_error.py +32 -0
  170. telnyx/types/phone_number_delete_response.py +7 -0
  171. telnyx/types/phone_number_detailed.py +7 -0
  172. telnyx/types/phone_number_list_params.py +6 -0
  173. telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
  174. telnyx/types/phone_numbers/phone_numbers_job.py +3 -36
  175. telnyx/types/porting_order.py +3 -0
  176. telnyx/types/porting_order_create_params.py +3 -0
  177. telnyx/types/porting_order_list_params.py +52 -31
  178. telnyx/types/porting_order_update_params.py +2 -0
  179. telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
  180. telnyx/types/report_list_mdrs_response.py +3 -12
  181. telnyx/types/reports/__init__.py +1 -0
  182. telnyx/types/reports/mdr_usage_report_list_response.py +3 -12
  183. telnyx/types/reports/pagination_meta_reporting.py +17 -0
  184. telnyx/types/requirement_group.py +2 -2
  185. telnyx/types/requirement_group_list_params.py +1 -1
  186. telnyx/types/shared/__init__.py +1 -0
  187. telnyx/types/{error.py → shared/api_error.py} +3 -3
  188. telnyx/types/shared/simple_sim_card.py +15 -0
  189. telnyx/types/sim_card.py +12 -0
  190. telnyx/types/sim_card_update_params.py +2 -1
  191. telnyx/types/stream_bidirectional_codec.py +1 -1
  192. telnyx/types/stream_bidirectional_sampling_rate.py +7 -0
  193. telnyx/types/stream_codec.py +1 -1
  194. telnyx/types/texml/accounts/call_calls_params.py +16 -1
  195. telnyx/types/texml/accounts/conferences/participant_participants_params.py +16 -1
  196. telnyx/types/verification_trigger_call_params.py +7 -0
  197. telnyx/types/verifications/__init__.py +1 -0
  198. telnyx/types/verifications/by_phone_number_list_response.py +4 -13
  199. telnyx/types/verifications/verify_meta.py +17 -0
  200. telnyx/types/verified_number_create_params.py +10 -0
  201. telnyx/types/verify_profile.py +18 -3
  202. telnyx/types/verify_profile_create_template_params.py +12 -0
  203. telnyx/types/verify_profile_list_response.py +4 -13
  204. telnyx/types/verify_profile_message_template_response.py +13 -0
  205. telnyx/types/verify_profile_retrieve_templates_response.py +4 -9
  206. telnyx/types/verify_profile_update_template_params.py +12 -0
  207. telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
  208. telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
  209. {telnyx-3.5.0a0.dist-info → telnyx-3.6.0.dist-info}/METADATA +4 -4
  210. {telnyx-3.5.0a0.dist-info → telnyx-3.6.0.dist-info}/RECORD +212 -121
  211. telnyx/types/ai/assistant_create_response.py +0 -92
  212. telnyx/types/ai/assistant_retrieve_response.py +0 -92
  213. telnyx/types/ai/assistants/version_promote_response.py +0 -92
  214. telnyx/types/ai/assistants/version_retrieve_response.py +0 -92
  215. telnyx/types/ai/assistants/version_update_response.py +0 -92
  216. telnyx/types/client_create_bucket_params.py +0 -13
  217. telnyx/types/client_delete_objects_params.py +0 -20
  218. telnyx/types/client_get_object_params.py +0 -15
  219. telnyx/types/client_list_objects_params.py +0 -13
  220. telnyx/types/client_put_object_params.py +0 -20
  221. telnyx/types/list_buckets_response.py +0 -20
  222. telnyx/types/list_objects_response.py +0 -24
  223. {telnyx-3.5.0a0.dist-info → telnyx-3.6.0.dist-info}/WHEEL +0 -0
  224. {telnyx-3.5.0a0.dist-info → telnyx-3.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -12,6 +12,7 @@ from ...types import (
12
12
  StreamBidirectionalMode,
13
13
  StreamBidirectionalCodec,
14
14
  StreamBidirectionalTargetLegs,
15
+ StreamBidirectionalSamplingRate,
15
16
  call_dial_params,
16
17
  )
17
18
  from .actions import (
@@ -43,6 +44,7 @@ from ...types.stream_bidirectional_mode import StreamBidirectionalMode
43
44
  from ...types.stream_bidirectional_codec import StreamBidirectionalCodec
44
45
  from ...types.call_retrieve_status_response import CallRetrieveStatusResponse
45
46
  from ...types.stream_bidirectional_target_legs import StreamBidirectionalTargetLegs
47
+ from ...types.stream_bidirectional_sampling_rate import StreamBidirectionalSamplingRate
46
48
  from ...types.calls.transcription_start_request_param import TranscriptionStartRequestParam
47
49
 
48
50
  __all__ = ["CallsResource", "AsyncCallsResource"]
@@ -97,6 +99,7 @@ class CallsResource(SyncAPIResource):
97
99
  link_to: str | Omit = omit,
98
100
  media_encryption: Literal["disabled", "SRTP", "DTLS"] | Omit = omit,
99
101
  media_name: str | Omit = omit,
102
+ park_after_unbridge: str | Omit = omit,
100
103
  preferred_codecs: str | Omit = omit,
101
104
  record: Literal["record-from-answer"] | Omit = omit,
102
105
  record_channels: Literal["single", "dual"] | Omit = omit,
@@ -114,7 +117,7 @@ class CallsResource(SyncAPIResource):
114
117
  sound_modifications: SoundModificationsParam | Omit = omit,
115
118
  stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
116
119
  stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
117
- stream_bidirectional_sampling_rate: Literal[8000, 16000, 48000] | Omit = omit,
120
+ stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
118
121
  stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
119
122
  stream_codec: StreamCodec | Omit = omit,
120
123
  stream_establish_before_call_originate: bool | Omit = omit,
@@ -141,9 +144,7 @@ class CallsResource(SyncAPIResource):
141
144
  include a `call_leg_id` which can be used to correlate the command with
142
145
  subsequent webhooks.
143
146
 
144
- **Expected Webhooks (see
145
- [schema](https://developers.telnyx.com/api/call-control/dial-call#callbacks)
146
- below):**
147
+ **Expected Webhooks:**
147
148
 
148
149
  - `call.initiated`
149
150
  - `call.answered` or `call.hangup`
@@ -232,6 +233,10 @@ class CallsResource(SyncAPIResource):
232
233
  api.telnyx.com/v2/media by the same user/organization. The file must either be a
233
234
  WAV or MP3 file.
234
235
 
236
+ park_after_unbridge: If supplied with the value `self`, the current leg will be parked after
237
+ unbridge. If not set, the default behavior is to hang up the leg. When
238
+ park_after_unbridge is set, link_to becomes required.
239
+
235
240
  preferred_codecs: The list of comma-separated codecs in a preferred order for the forked media to
236
241
  be received.
237
242
 
@@ -286,7 +291,6 @@ class CallsResource(SyncAPIResource):
286
291
 
287
292
  stream_codec: Specifies the codec to be used for the streamed audio. When set to 'default' or
288
293
  when transcoding is not possible, the codec from the call will be used.
289
- Currently, transcoding is only supported between PCMU and PCMA codecs.
290
294
 
291
295
  stream_establish_before_call_originate: Establish websocket connection before dialing the destination. This is useful
292
296
  for cases where the websocket connection takes a long time to establish.
@@ -354,6 +358,7 @@ class CallsResource(SyncAPIResource):
354
358
  "link_to": link_to,
355
359
  "media_encryption": media_encryption,
356
360
  "media_name": media_name,
361
+ "park_after_unbridge": park_after_unbridge,
357
362
  "preferred_codecs": preferred_codecs,
358
363
  "record": record,
359
364
  "record_channels": record_channels,
@@ -477,6 +482,7 @@ class AsyncCallsResource(AsyncAPIResource):
477
482
  link_to: str | Omit = omit,
478
483
  media_encryption: Literal["disabled", "SRTP", "DTLS"] | Omit = omit,
479
484
  media_name: str | Omit = omit,
485
+ park_after_unbridge: str | Omit = omit,
480
486
  preferred_codecs: str | Omit = omit,
481
487
  record: Literal["record-from-answer"] | Omit = omit,
482
488
  record_channels: Literal["single", "dual"] | Omit = omit,
@@ -494,7 +500,7 @@ class AsyncCallsResource(AsyncAPIResource):
494
500
  sound_modifications: SoundModificationsParam | Omit = omit,
495
501
  stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
496
502
  stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
497
- stream_bidirectional_sampling_rate: Literal[8000, 16000, 48000] | Omit = omit,
503
+ stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
498
504
  stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
499
505
  stream_codec: StreamCodec | Omit = omit,
500
506
  stream_establish_before_call_originate: bool | Omit = omit,
@@ -521,9 +527,7 @@ class AsyncCallsResource(AsyncAPIResource):
521
527
  include a `call_leg_id` which can be used to correlate the command with
522
528
  subsequent webhooks.
523
529
 
524
- **Expected Webhooks (see
525
- [schema](https://developers.telnyx.com/api/call-control/dial-call#callbacks)
526
- below):**
530
+ **Expected Webhooks:**
527
531
 
528
532
  - `call.initiated`
529
533
  - `call.answered` or `call.hangup`
@@ -612,6 +616,10 @@ class AsyncCallsResource(AsyncAPIResource):
612
616
  api.telnyx.com/v2/media by the same user/organization. The file must either be a
613
617
  WAV or MP3 file.
614
618
 
619
+ park_after_unbridge: If supplied with the value `self`, the current leg will be parked after
620
+ unbridge. If not set, the default behavior is to hang up the leg. When
621
+ park_after_unbridge is set, link_to becomes required.
622
+
615
623
  preferred_codecs: The list of comma-separated codecs in a preferred order for the forked media to
616
624
  be received.
617
625
 
@@ -666,7 +674,6 @@ class AsyncCallsResource(AsyncAPIResource):
666
674
 
667
675
  stream_codec: Specifies the codec to be used for the streamed audio. When set to 'default' or
668
676
  when transcoding is not possible, the codec from the call will be used.
669
- Currently, transcoding is only supported between PCMU and PCMA codecs.
670
677
 
671
678
  stream_establish_before_call_originate: Establish websocket connection before dialing the destination. This is useful
672
679
  for cases where the websocket connection takes a long time to establish.
@@ -734,6 +741,7 @@ class AsyncCallsResource(AsyncAPIResource):
734
741
  "link_to": link_to,
735
742
  "media_encryption": media_encryption,
736
743
  "media_name": media_name,
744
+ "park_after_unbridge": park_after_unbridge,
737
745
  "preferred_codecs": preferred_codecs,
738
746
  "record": record,
739
747
  "record_channels": record_channels,
@@ -221,9 +221,7 @@ class ActionsResource(SyncAPIResource):
221
221
  certain amount of active participants, as set by the `max_participants`
222
222
  parameter in conference creation request.
223
223
 
224
- **Expected Webhooks (see
225
- [callback schema](https://developers.telnyx.com/api/call-control/join-conference#callbacks)
226
- below):**
224
+ **Expected Webhooks:**
227
225
 
228
226
  - `conference.participant.joined`
229
227
  - `conference.participant.left`
@@ -334,9 +332,7 @@ class ActionsResource(SyncAPIResource):
334
332
  """
335
333
  Removes a call leg from a conference and moves it back to parked state.
336
334
 
337
- **Expected Webhooks (see
338
- [callback schema](https://developers.telnyx.com/api/call-control/leave-conference#callbacks)
339
- below):**
335
+ **Expected Webhooks:**
340
336
 
341
337
  - `conference.participant.left`
342
338
 
@@ -589,9 +585,7 @@ class ActionsResource(SyncAPIResource):
589
585
  Recording will stop on conference end, or via
590
586
  the Stop Recording command.
591
587
 
592
- **Expected Webhooks (see
593
- [callback schema](https://developers.telnyx.com/api/call-control/start-conference-recording#callbacks)
594
- below):**
588
+ **Expected Webhooks:**
595
589
 
596
590
  - `conference.recording.saved`
597
591
 
@@ -655,9 +649,7 @@ class ActionsResource(SyncAPIResource):
655
649
  """
656
650
  Stop recording the conference.
657
651
 
658
- **Expected Webhooks (see
659
- [callback schema](https://developers.telnyx.com/api/call-control/stop-conference-recording#callbacks)
660
- below):**
652
+ **Expected Webhooks:**
661
653
 
662
654
  - `conference.recording.saved`
663
655
 
@@ -1109,9 +1101,7 @@ class AsyncActionsResource(AsyncAPIResource):
1109
1101
  certain amount of active participants, as set by the `max_participants`
1110
1102
  parameter in conference creation request.
1111
1103
 
1112
- **Expected Webhooks (see
1113
- [callback schema](https://developers.telnyx.com/api/call-control/join-conference#callbacks)
1114
- below):**
1104
+ **Expected Webhooks:**
1115
1105
 
1116
1106
  - `conference.participant.joined`
1117
1107
  - `conference.participant.left`
@@ -1222,9 +1212,7 @@ class AsyncActionsResource(AsyncAPIResource):
1222
1212
  """
1223
1213
  Removes a call leg from a conference and moves it back to parked state.
1224
1214
 
1225
- **Expected Webhooks (see
1226
- [callback schema](https://developers.telnyx.com/api/call-control/leave-conference#callbacks)
1227
- below):**
1215
+ **Expected Webhooks:**
1228
1216
 
1229
1217
  - `conference.participant.left`
1230
1218
 
@@ -1479,9 +1467,7 @@ class AsyncActionsResource(AsyncAPIResource):
1479
1467
  Recording will stop on conference end, or via
1480
1468
  the Stop Recording command.
1481
1469
 
1482
- **Expected Webhooks (see
1483
- [callback schema](https://developers.telnyx.com/api/call-control/start-conference-recording#callbacks)
1484
- below):**
1470
+ **Expected Webhooks:**
1485
1471
 
1486
1472
  - `conference.recording.saved`
1487
1473
 
@@ -1545,9 +1531,7 @@ class AsyncActionsResource(AsyncAPIResource):
1545
1531
  """
1546
1532
  Stop recording the conference.
1547
1533
 
1548
- **Expected Webhooks (see
1549
- [callback schema](https://developers.telnyx.com/api/call-control/stop-conference-recording#callbacks)
1550
- below):**
1534
+ **Expected Webhooks:**
1551
1535
 
1552
1536
  - `conference.recording.saved`
1553
1537
 
@@ -86,9 +86,7 @@ class ConferencesResource(SyncAPIResource):
86
86
  left the conference or after 4 hours regardless of the number of active
87
87
  participants.
88
88
 
89
- **Expected Webhooks (see
90
- [callback schema](https://developers.telnyx.com/api/call-control/create-conference#callbacks)
91
- below):**
89
+ **Expected Webhooks:**
92
90
 
93
91
  - `conference.created`
94
92
  - `conference.participant.joined`
@@ -360,9 +358,7 @@ class AsyncConferencesResource(AsyncAPIResource):
360
358
  left the conference or after 4 hours regardless of the number of active
361
359
  participants.
362
360
 
363
- **Expected Webhooks (see
364
- [callback schema](https://developers.telnyx.com/api/call-control/create-conference#callbacks)
365
- below):**
361
+ **Expected Webhooks:**
366
362
 
367
363
  - `conference.created`
368
364
  - `conference.participant.joined`
@@ -2,14 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Mapping, cast
5
+ from typing import List, Union
6
6
  from typing_extensions import Literal, overload
7
7
 
8
8
  import httpx
9
9
 
10
- from ..types import document_list_params, document_update_params, document_upload_params
10
+ from ..types import document_list_params, document_update_params, document_upload_params, document_upload_json_params
11
11
  from .._types import Body, Omit, Query, Headers, NotGiven, Base64FileInput, omit, not_given
12
- from .._utils import extract_files, required_args, maybe_transform, deepcopy_minimal, async_maybe_transform
12
+ from .._utils import required_args, maybe_transform, async_maybe_transform
13
13
  from .._compat import cached_property
14
14
  from .._resource import SyncAPIResource, AsyncAPIResource
15
15
  from .._response import (
@@ -32,6 +32,7 @@ from ..types.document_delete_response import DocumentDeleteResponse
32
32
  from ..types.document_update_response import DocumentUpdateResponse
33
33
  from ..types.document_upload_response import DocumentUploadResponse
34
34
  from ..types.document_retrieve_response import DocumentRetrieveResponse
35
+ from ..types.document_upload_json_response import DocumentUploadJsonResponse
35
36
  from ..types.document_generate_download_link_response import DocumentGenerateDownloadLinkResponse
36
37
 
37
38
  __all__ = ["DocumentsResource", "AsyncDocumentsResource"]
@@ -380,30 +381,126 @@ class DocumentsResource(SyncAPIResource):
380
381
  extra_body: Body | None = None,
381
382
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
382
383
  ) -> DocumentUploadResponse:
383
- body = deepcopy_minimal(
384
- {
385
- "url": url,
386
- "customer_reference": customer_reference,
387
- "filename": filename,
388
- "file": file,
389
- }
390
- )
391
- files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
392
- if files:
393
- # It should be noted that the actual Content-Type header that will be
394
- # sent to the server will contain a `boundary` parameter, e.g.
395
- # multipart/form-data; boundary=---abc--
396
- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
397
384
  return self._post(
398
- "/documents",
399
- body=maybe_transform(body, document_upload_params.DocumentUploadParams),
400
- files=files,
385
+ "/documents?content-type=multipart",
386
+ body=maybe_transform(
387
+ {
388
+ "url": url,
389
+ "customer_reference": customer_reference,
390
+ "filename": filename,
391
+ "file": file,
392
+ },
393
+ document_upload_params.DocumentUploadParams,
394
+ ),
401
395
  options=make_request_options(
402
396
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
403
397
  ),
404
398
  cast_to=DocumentUploadResponse,
405
399
  )
406
400
 
401
+ @overload
402
+ def upload_json(
403
+ self,
404
+ *,
405
+ url: str,
406
+ customer_reference: str | Omit = omit,
407
+ filename: str | Omit = omit,
408
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
409
+ # The extra values given here take precedence over values defined on the client or passed to this method.
410
+ extra_headers: Headers | None = None,
411
+ extra_query: Query | None = None,
412
+ extra_body: Body | None = None,
413
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
414
+ ) -> DocumentUploadJsonResponse:
415
+ """
416
+ Upload a document.<br /><br />Uploaded files must be linked to a service within
417
+ 30 minutes or they will be automatically deleted.
418
+
419
+ Args:
420
+ url: If the file is already hosted publicly, you can provide a URL and have the
421
+ documents service fetch it for you.
422
+
423
+ customer_reference: Optional reference string for customer tracking.
424
+
425
+ filename: The filename of the document.
426
+
427
+ extra_headers: Send extra headers
428
+
429
+ extra_query: Add additional query parameters to the request
430
+
431
+ extra_body: Add additional JSON properties to the request
432
+
433
+ timeout: Override the client-level default timeout for this request, in seconds
434
+ """
435
+ ...
436
+
437
+ @overload
438
+ def upload_json(
439
+ self,
440
+ *,
441
+ file: Union[str, Base64FileInput],
442
+ customer_reference: str | Omit = omit,
443
+ filename: str | Omit = omit,
444
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
445
+ # The extra values given here take precedence over values defined on the client or passed to this method.
446
+ extra_headers: Headers | None = None,
447
+ extra_query: Query | None = None,
448
+ extra_body: Body | None = None,
449
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
450
+ ) -> DocumentUploadJsonResponse:
451
+ """
452
+ Upload a document.<br /><br />Uploaded files must be linked to a service within
453
+ 30 minutes or they will be automatically deleted.
454
+
455
+ Args:
456
+ file: The Base64 encoded contents of the file you are uploading.
457
+
458
+ customer_reference: A customer reference string for customer look ups.
459
+
460
+ filename: The filename of the document.
461
+
462
+ extra_headers: Send extra headers
463
+
464
+ extra_query: Add additional query parameters to the request
465
+
466
+ extra_body: Add additional JSON properties to the request
467
+
468
+ timeout: Override the client-level default timeout for this request, in seconds
469
+ """
470
+ ...
471
+
472
+ @required_args(["url"], ["file"])
473
+ def upload_json(
474
+ self,
475
+ *,
476
+ url: str | Omit = omit,
477
+ customer_reference: str | Omit = omit,
478
+ filename: str | Omit = omit,
479
+ file: Union[str, Base64FileInput] | Omit = omit,
480
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
481
+ # The extra values given here take precedence over values defined on the client or passed to this method.
482
+ extra_headers: Headers | None = None,
483
+ extra_query: Query | None = None,
484
+ extra_body: Body | None = None,
485
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
486
+ ) -> DocumentUploadJsonResponse:
487
+ return self._post(
488
+ "/documents",
489
+ body=maybe_transform(
490
+ {
491
+ "url": url,
492
+ "customer_reference": customer_reference,
493
+ "filename": filename,
494
+ "file": file,
495
+ },
496
+ document_upload_json_params.DocumentUploadJsonParams,
497
+ ),
498
+ options=make_request_options(
499
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
500
+ ),
501
+ cast_to=DocumentUploadJsonResponse,
502
+ )
503
+
407
504
 
408
505
  class AsyncDocumentsResource(AsyncAPIResource):
409
506
  @cached_property
@@ -748,30 +845,126 @@ class AsyncDocumentsResource(AsyncAPIResource):
748
845
  extra_body: Body | None = None,
749
846
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
750
847
  ) -> DocumentUploadResponse:
751
- body = deepcopy_minimal(
752
- {
753
- "url": url,
754
- "customer_reference": customer_reference,
755
- "filename": filename,
756
- "file": file,
757
- }
758
- )
759
- files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
760
- if files:
761
- # It should be noted that the actual Content-Type header that will be
762
- # sent to the server will contain a `boundary` parameter, e.g.
763
- # multipart/form-data; boundary=---abc--
764
- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
765
848
  return await self._post(
766
- "/documents",
767
- body=await async_maybe_transform(body, document_upload_params.DocumentUploadParams),
768
- files=files,
849
+ "/documents?content-type=multipart",
850
+ body=await async_maybe_transform(
851
+ {
852
+ "url": url,
853
+ "customer_reference": customer_reference,
854
+ "filename": filename,
855
+ "file": file,
856
+ },
857
+ document_upload_params.DocumentUploadParams,
858
+ ),
769
859
  options=make_request_options(
770
860
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
771
861
  ),
772
862
  cast_to=DocumentUploadResponse,
773
863
  )
774
864
 
865
+ @overload
866
+ async def upload_json(
867
+ self,
868
+ *,
869
+ url: str,
870
+ customer_reference: str | Omit = omit,
871
+ filename: str | Omit = omit,
872
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
873
+ # The extra values given here take precedence over values defined on the client or passed to this method.
874
+ extra_headers: Headers | None = None,
875
+ extra_query: Query | None = None,
876
+ extra_body: Body | None = None,
877
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
878
+ ) -> DocumentUploadJsonResponse:
879
+ """
880
+ Upload a document.<br /><br />Uploaded files must be linked to a service within
881
+ 30 minutes or they will be automatically deleted.
882
+
883
+ Args:
884
+ url: If the file is already hosted publicly, you can provide a URL and have the
885
+ documents service fetch it for you.
886
+
887
+ customer_reference: Optional reference string for customer tracking.
888
+
889
+ filename: The filename of the document.
890
+
891
+ extra_headers: Send extra headers
892
+
893
+ extra_query: Add additional query parameters to the request
894
+
895
+ extra_body: Add additional JSON properties to the request
896
+
897
+ timeout: Override the client-level default timeout for this request, in seconds
898
+ """
899
+ ...
900
+
901
+ @overload
902
+ async def upload_json(
903
+ self,
904
+ *,
905
+ file: Union[str, Base64FileInput],
906
+ customer_reference: str | Omit = omit,
907
+ filename: str | Omit = omit,
908
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
909
+ # The extra values given here take precedence over values defined on the client or passed to this method.
910
+ extra_headers: Headers | None = None,
911
+ extra_query: Query | None = None,
912
+ extra_body: Body | None = None,
913
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
914
+ ) -> DocumentUploadJsonResponse:
915
+ """
916
+ Upload a document.<br /><br />Uploaded files must be linked to a service within
917
+ 30 minutes or they will be automatically deleted.
918
+
919
+ Args:
920
+ file: The Base64 encoded contents of the file you are uploading.
921
+
922
+ customer_reference: A customer reference string for customer look ups.
923
+
924
+ filename: The filename of the document.
925
+
926
+ extra_headers: Send extra headers
927
+
928
+ extra_query: Add additional query parameters to the request
929
+
930
+ extra_body: Add additional JSON properties to the request
931
+
932
+ timeout: Override the client-level default timeout for this request, in seconds
933
+ """
934
+ ...
935
+
936
+ @required_args(["url"], ["file"])
937
+ async def upload_json(
938
+ self,
939
+ *,
940
+ url: str | Omit = omit,
941
+ customer_reference: str | Omit = omit,
942
+ filename: str | Omit = omit,
943
+ file: Union[str, Base64FileInput] | Omit = omit,
944
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
945
+ # The extra values given here take precedence over values defined on the client or passed to this method.
946
+ extra_headers: Headers | None = None,
947
+ extra_query: Query | None = None,
948
+ extra_body: Body | None = None,
949
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
950
+ ) -> DocumentUploadJsonResponse:
951
+ return await self._post(
952
+ "/documents",
953
+ body=await async_maybe_transform(
954
+ {
955
+ "url": url,
956
+ "customer_reference": customer_reference,
957
+ "filename": filename,
958
+ "file": file,
959
+ },
960
+ document_upload_json_params.DocumentUploadJsonParams,
961
+ ),
962
+ options=make_request_options(
963
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
964
+ ),
965
+ cast_to=DocumentUploadJsonResponse,
966
+ )
967
+
775
968
 
776
969
  class DocumentsResourceWithRawResponse:
777
970
  def __init__(self, documents: DocumentsResource) -> None:
@@ -799,6 +992,9 @@ class DocumentsResourceWithRawResponse:
799
992
  self.upload = to_raw_response_wrapper(
800
993
  documents.upload,
801
994
  )
995
+ self.upload_json = to_raw_response_wrapper(
996
+ documents.upload_json,
997
+ )
802
998
 
803
999
 
804
1000
  class AsyncDocumentsResourceWithRawResponse:
@@ -827,6 +1023,9 @@ class AsyncDocumentsResourceWithRawResponse:
827
1023
  self.upload = async_to_raw_response_wrapper(
828
1024
  documents.upload,
829
1025
  )
1026
+ self.upload_json = async_to_raw_response_wrapper(
1027
+ documents.upload_json,
1028
+ )
830
1029
 
831
1030
 
832
1031
  class DocumentsResourceWithStreamingResponse:
@@ -855,6 +1054,9 @@ class DocumentsResourceWithStreamingResponse:
855
1054
  self.upload = to_streamed_response_wrapper(
856
1055
  documents.upload,
857
1056
  )
1057
+ self.upload_json = to_streamed_response_wrapper(
1058
+ documents.upload_json,
1059
+ )
858
1060
 
859
1061
 
860
1062
  class AsyncDocumentsResourceWithStreamingResponse:
@@ -883,3 +1085,6 @@ class AsyncDocumentsResourceWithStreamingResponse:
883
1085
  self.upload = async_to_streamed_response_wrapper(
884
1086
  documents.upload,
885
1087
  )
1088
+ self.upload_json = async_to_streamed_response_wrapper(
1089
+ documents.upload_json,
1090
+ )
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .legacy import (
4
+ LegacyResource,
5
+ AsyncLegacyResource,
6
+ LegacyResourceWithRawResponse,
7
+ AsyncLegacyResourceWithRawResponse,
8
+ LegacyResourceWithStreamingResponse,
9
+ AsyncLegacyResourceWithStreamingResponse,
10
+ )
11
+ from .reporting import (
12
+ ReportingResource,
13
+ AsyncReportingResource,
14
+ ReportingResourceWithRawResponse,
15
+ AsyncReportingResourceWithRawResponse,
16
+ ReportingResourceWithStreamingResponse,
17
+ AsyncReportingResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "ReportingResource",
22
+ "AsyncReportingResource",
23
+ "ReportingResourceWithRawResponse",
24
+ "AsyncReportingResourceWithRawResponse",
25
+ "ReportingResourceWithStreamingResponse",
26
+ "AsyncReportingResourceWithStreamingResponse",
27
+ "LegacyResource",
28
+ "AsyncLegacyResource",
29
+ "LegacyResourceWithRawResponse",
30
+ "AsyncLegacyResourceWithRawResponse",
31
+ "LegacyResourceWithStreamingResponse",
32
+ "AsyncLegacyResourceWithStreamingResponse",
33
+ ]