telnyx 3.5.0a0__py3-none-any.whl → 3.7.0a0__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 (130) hide show
  1. telnyx/_client.py +53 -2
  2. telnyx/_version.py +1 -1
  3. telnyx/resources/__init__.py +70 -0
  4. telnyx/resources/ai/conversations/conversations.py +137 -3
  5. telnyx/resources/ai/conversations/messages.py +1 -134
  6. telnyx/resources/calls/actions.py +146 -146
  7. telnyx/resources/calls/calls.py +4 -10
  8. telnyx/resources/conferences/actions.py +8 -24
  9. telnyx/resources/conferences/conferences.py +2 -6
  10. telnyx/resources/legacy/__init__.py +33 -0
  11. telnyx/resources/legacy/legacy.py +102 -0
  12. telnyx/resources/legacy/reporting/__init__.py +47 -0
  13. telnyx/resources/legacy/reporting/batch_detail_records/__init__.py +61 -0
  14. telnyx/resources/legacy/reporting/batch_detail_records/batch_detail_records.py +166 -0
  15. telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +481 -0
  16. telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
  17. telnyx/resources/legacy/reporting/batch_detail_records/voice.py +538 -0
  18. telnyx/resources/legacy/reporting/reporting.py +134 -0
  19. telnyx/resources/legacy/reporting/usage_reports/__init__.py +61 -0
  20. telnyx/resources/legacy/reporting/usage_reports/messaging.py +471 -0
  21. telnyx/resources/legacy/reporting/usage_reports/number_lookup.py +464 -0
  22. telnyx/resources/legacy/reporting/usage_reports/usage_reports.py +288 -0
  23. telnyx/resources/legacy/reporting/usage_reports/voice.py +493 -0
  24. telnyx/resources/oauth.py +855 -0
  25. telnyx/resources/oauth_clients.py +711 -0
  26. telnyx/resources/oauth_grants.py +349 -0
  27. telnyx/resources/phone_numbers/jobs.py +12 -0
  28. telnyx/resources/porting_orders/porting_orders.py +20 -8
  29. telnyx/resources/sim_cards/sim_cards.py +3 -2
  30. telnyx/resources/verifications/verifications.py +10 -0
  31. telnyx/resources/verify_profiles.py +183 -1
  32. telnyx/resources/well_known.py +198 -0
  33. telnyx/types/__init__.py +41 -1
  34. telnyx/types/addresses/action_validate_response.py +2 -2
  35. telnyx/types/ai/__init__.py +1 -0
  36. telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
  37. telnyx/types/ai/conversations/__init__.py +0 -1
  38. telnyx/types/ai/inference_embedding_webhook_tool_params.py +2 -0
  39. telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +2 -0
  40. telnyx/types/{error.py → api_error.py} +2 -2
  41. telnyx/types/call_dial_params.py +2 -3
  42. telnyx/types/calls/action_answer_params.py +1 -2
  43. telnyx/types/calls/action_gather_using_ai_params.py +5 -8
  44. telnyx/types/calls/action_start_streaming_params.py +4 -2
  45. telnyx/types/calls/action_transfer_params.py +50 -0
  46. telnyx/types/campaign_submit_appeal_response.py +0 -3
  47. telnyx/types/legacy/__init__.py +3 -0
  48. telnyx/types/legacy/reporting/__init__.py +10 -0
  49. telnyx/types/legacy/reporting/batch_detail_records/__init__.py +20 -0
  50. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +77 -0
  51. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +68 -0
  52. telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +68 -0
  53. telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +80 -0
  54. telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +68 -0
  55. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_params.py +19 -0
  56. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +31 -0
  57. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +31 -0
  58. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +31 -0
  59. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +31 -0
  60. telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +79 -0
  61. telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +91 -0
  62. telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +91 -0
  63. telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +102 -0
  64. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_fields_response.py +23 -0
  65. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +91 -0
  66. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_params.py +17 -0
  67. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_response.py +11 -0
  68. telnyx/types/legacy/reporting/usage_reports/__init__.py +18 -0
  69. telnyx/types/legacy/reporting/usage_reports/messaging_create_params.py +29 -0
  70. telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +43 -0
  71. telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +43 -0
  72. telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
  73. telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +54 -0
  74. telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +43 -0
  75. telnyx/types/legacy/reporting/usage_reports/number_lookup_create_params.py +26 -0
  76. telnyx/types/legacy/reporting/usage_reports/number_lookup_list_params.py +13 -0
  77. telnyx/types/legacy/reporting/usage_reports/voice_create_params.py +40 -0
  78. telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +48 -0
  79. telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +48 -0
  80. telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
  81. telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +59 -0
  82. telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +48 -0
  83. telnyx/types/number_order_status_update_webhook_event.py +30 -4
  84. telnyx/types/oauth_client_create_params.py +39 -0
  85. telnyx/types/oauth_client_create_response.py +63 -0
  86. telnyx/types/oauth_client_list_params.py +38 -0
  87. telnyx/types/oauth_client_list_response.py +79 -0
  88. telnyx/types/oauth_client_retrieve_response.py +63 -0
  89. telnyx/types/oauth_client_update_params.py +36 -0
  90. telnyx/types/oauth_client_update_response.py +63 -0
  91. telnyx/types/oauth_grant_delete_response.py +33 -0
  92. telnyx/types/oauth_grant_list_params.py +17 -0
  93. telnyx/types/oauth_grant_list_response.py +49 -0
  94. telnyx/types/oauth_grant_retrieve_response.py +33 -0
  95. telnyx/types/oauth_grants_params.py +15 -0
  96. telnyx/types/oauth_grants_response.py +10 -0
  97. telnyx/types/oauth_introspect_params.py +12 -0
  98. telnyx/types/oauth_introspect_response.py +30 -0
  99. telnyx/types/oauth_register_params.py +39 -0
  100. telnyx/types/oauth_register_response.py +45 -0
  101. telnyx/types/oauth_retrieve_authorize_params.py +30 -0
  102. telnyx/types/oauth_retrieve_jwks_response.py +25 -0
  103. telnyx/types/oauth_retrieve_response.py +47 -0
  104. telnyx/types/oauth_token_params.py +33 -0
  105. telnyx/types/oauth_token_response.py +25 -0
  106. telnyx/types/phone_number_delete_response.py +7 -0
  107. telnyx/types/phone_number_detailed.py +7 -0
  108. telnyx/types/phone_number_list_params.py +6 -0
  109. telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
  110. telnyx/types/porting_order.py +3 -0
  111. telnyx/types/porting_order_create_params.py +3 -0
  112. telnyx/types/porting_order_list_params.py +52 -31
  113. telnyx/types/porting_order_update_params.py +2 -0
  114. telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
  115. telnyx/types/shared/simple_sim_card.py +15 -0
  116. telnyx/types/sim_card.py +12 -0
  117. telnyx/types/sim_card_update_params.py +2 -1
  118. telnyx/types/stream_bidirectional_codec.py +1 -1
  119. telnyx/types/stream_codec.py +1 -1
  120. telnyx/types/verification_trigger_call_params.py +7 -0
  121. telnyx/types/verify_profile_create_template_params.py +12 -0
  122. telnyx/types/verify_profile_create_template_response.py +17 -0
  123. telnyx/types/verify_profile_update_template_params.py +12 -0
  124. telnyx/types/verify_profile_update_template_response.py +17 -0
  125. telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
  126. telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
  127. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/METADATA +1 -1
  128. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/RECORD +130 -48
  129. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/WHEEL +0 -0
  130. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/licenses/LICENSE +0 -0
telnyx/_client.py CHANGED
@@ -60,6 +60,7 @@ from .resources import (
60
60
  seti,
61
61
  fqdns,
62
62
  media,
63
+ oauth,
63
64
  balance,
64
65
  regions,
65
66
  comments,
@@ -69,15 +70,18 @@ from .resources import (
69
70
  messsages,
70
71
  user_tags,
71
72
  global_ips,
73
+ well_known,
72
74
  call_events,
73
75
  connections,
74
76
  ota_updates,
75
77
  short_codes,
76
78
  audit_events,
79
+ oauth_grants,
77
80
  requirements,
78
81
  channel_zones,
79
82
  number_lookup,
80
83
  number_orders,
84
+ oauth_clients,
81
85
  usage_reports,
82
86
  billing_groups,
83
87
  detail_records,
@@ -178,6 +182,7 @@ from .resources.calls import calls
178
182
  from .resources.faxes import faxes
179
183
  from .resources.rooms import rooms
180
184
  from .resources.texml import texml
185
+ from .resources.legacy import legacy
181
186
  from .resources.queues import queues
182
187
  from .resources.actions import actions
183
188
  from .resources.payment import payment
@@ -217,6 +222,10 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Telnyx", "
217
222
 
218
223
 
219
224
  class Telnyx(SyncAPIClient):
225
+ legacy: legacy.LegacyResource
226
+ oauth: oauth.OAuthResource
227
+ oauth_clients: oauth_clients.OAuthClientsResource
228
+ oauth_grants: oauth_grants.OAuthGrantsResource
220
229
  webhooks: webhooks.WebhooksResource
221
230
  access_ip_address: access_ip_address.AccessIPAddressResource
222
231
  access_ip_ranges: access_ip_ranges.AccessIPRangesResource
@@ -366,6 +375,7 @@ class Telnyx(SyncAPIClient):
366
375
  wireless_blocklist_values: wireless_blocklist_values.WirelessBlocklistValuesResource
367
376
  wireless_blocklists: wireless_blocklists.WirelessBlocklistsResource
368
377
  partner_campaigns: partner_campaigns.PartnerCampaignsResource
378
+ well_known: well_known.WellKnownResource
369
379
  with_raw_response: TelnyxWithRawResponse
370
380
  with_streaming_response: TelnyxWithStreamedResponse
371
381
 
@@ -409,6 +419,7 @@ class Telnyx(SyncAPIClient):
409
419
 
410
420
  if base_url is None:
411
421
  base_url = os.environ.get("TELNYX_BASE_URL")
422
+ self._base_url_overridden = base_url is not None
412
423
  if base_url is None:
413
424
  base_url = f"https://api.telnyx.com/v2"
414
425
 
@@ -423,6 +434,10 @@ class Telnyx(SyncAPIClient):
423
434
  _strict_response_validation=_strict_response_validation,
424
435
  )
425
436
 
437
+ self.legacy = legacy.LegacyResource(self)
438
+ self.oauth = oauth.OAuthResource(self)
439
+ self.oauth_clients = oauth_clients.OAuthClientsResource(self)
440
+ self.oauth_grants = oauth_grants.OAuthGrantsResource(self)
426
441
  self.webhooks = webhooks.WebhooksResource(self)
427
442
  self.access_ip_address = access_ip_address.AccessIPAddressResource(self)
428
443
  self.access_ip_ranges = access_ip_ranges.AccessIPRangesResource(self)
@@ -578,6 +593,7 @@ class Telnyx(SyncAPIClient):
578
593
  self.wireless_blocklist_values = wireless_blocklist_values.WirelessBlocklistValuesResource(self)
579
594
  self.wireless_blocklists = wireless_blocklists.WirelessBlocklistsResource(self)
580
595
  self.partner_campaigns = partner_campaigns.PartnerCampaignsResource(self)
596
+ self.well_known = well_known.WellKnownResource(self)
581
597
  self.with_raw_response = TelnyxWithRawResponse(self)
582
598
  self.with_streaming_response = TelnyxWithStreamedResponse(self)
583
599
 
@@ -637,7 +653,7 @@ class Telnyx(SyncAPIClient):
637
653
  params = set_default_query
638
654
 
639
655
  http_client = http_client or self._client
640
- return self.__class__(
656
+ client = self.__class__(
641
657
  api_key=api_key or self.api_key,
642
658
  base_url=base_url or self.base_url,
643
659
  timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -647,6 +663,8 @@ class Telnyx(SyncAPIClient):
647
663
  default_query=params,
648
664
  **_extra_kwargs,
649
665
  )
666
+ client._base_url_overridden = self._base_url_overridden or base_url is not None
667
+ return client
650
668
 
651
669
  # Alias for `copy` for nicer inline usage, e.g.
652
670
  # client.with_options(timeout=10).foo.create(...)
@@ -990,6 +1008,10 @@ class Telnyx(SyncAPIClient):
990
1008
 
991
1009
 
992
1010
  class AsyncTelnyx(AsyncAPIClient):
1011
+ legacy: legacy.AsyncLegacyResource
1012
+ oauth: oauth.AsyncOAuthResource
1013
+ oauth_clients: oauth_clients.AsyncOAuthClientsResource
1014
+ oauth_grants: oauth_grants.AsyncOAuthGrantsResource
993
1015
  webhooks: webhooks.AsyncWebhooksResource
994
1016
  access_ip_address: access_ip_address.AsyncAccessIPAddressResource
995
1017
  access_ip_ranges: access_ip_ranges.AsyncAccessIPRangesResource
@@ -1139,6 +1161,7 @@ class AsyncTelnyx(AsyncAPIClient):
1139
1161
  wireless_blocklist_values: wireless_blocklist_values.AsyncWirelessBlocklistValuesResource
1140
1162
  wireless_blocklists: wireless_blocklists.AsyncWirelessBlocklistsResource
1141
1163
  partner_campaigns: partner_campaigns.AsyncPartnerCampaignsResource
1164
+ well_known: well_known.AsyncWellKnownResource
1142
1165
  with_raw_response: AsyncTelnyxWithRawResponse
1143
1166
  with_streaming_response: AsyncTelnyxWithStreamedResponse
1144
1167
 
@@ -1182,6 +1205,7 @@ class AsyncTelnyx(AsyncAPIClient):
1182
1205
 
1183
1206
  if base_url is None:
1184
1207
  base_url = os.environ.get("TELNYX_BASE_URL")
1208
+ self._base_url_overridden = base_url is not None
1185
1209
  if base_url is None:
1186
1210
  base_url = f"https://api.telnyx.com/v2"
1187
1211
 
@@ -1196,6 +1220,10 @@ class AsyncTelnyx(AsyncAPIClient):
1196
1220
  _strict_response_validation=_strict_response_validation,
1197
1221
  )
1198
1222
 
1223
+ self.legacy = legacy.AsyncLegacyResource(self)
1224
+ self.oauth = oauth.AsyncOAuthResource(self)
1225
+ self.oauth_clients = oauth_clients.AsyncOAuthClientsResource(self)
1226
+ self.oauth_grants = oauth_grants.AsyncOAuthGrantsResource(self)
1199
1227
  self.webhooks = webhooks.AsyncWebhooksResource(self)
1200
1228
  self.access_ip_address = access_ip_address.AsyncAccessIPAddressResource(self)
1201
1229
  self.access_ip_ranges = access_ip_ranges.AsyncAccessIPRangesResource(self)
@@ -1357,6 +1385,7 @@ class AsyncTelnyx(AsyncAPIClient):
1357
1385
  self.wireless_blocklist_values = wireless_blocklist_values.AsyncWirelessBlocklistValuesResource(self)
1358
1386
  self.wireless_blocklists = wireless_blocklists.AsyncWirelessBlocklistsResource(self)
1359
1387
  self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResource(self)
1388
+ self.well_known = well_known.AsyncWellKnownResource(self)
1360
1389
  self.with_raw_response = AsyncTelnyxWithRawResponse(self)
1361
1390
  self.with_streaming_response = AsyncTelnyxWithStreamedResponse(self)
1362
1391
 
@@ -1416,7 +1445,7 @@ class AsyncTelnyx(AsyncAPIClient):
1416
1445
  params = set_default_query
1417
1446
 
1418
1447
  http_client = http_client or self._client
1419
- return self.__class__(
1448
+ client = self.__class__(
1420
1449
  api_key=api_key or self.api_key,
1421
1450
  base_url=base_url or self.base_url,
1422
1451
  timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -1426,6 +1455,8 @@ class AsyncTelnyx(AsyncAPIClient):
1426
1455
  default_query=params,
1427
1456
  **_extra_kwargs,
1428
1457
  )
1458
+ client._base_url_overridden = self._base_url_overridden or base_url is not None
1459
+ return client
1429
1460
 
1430
1461
  # Alias for `copy` for nicer inline usage, e.g.
1431
1462
  # client.with_options(timeout=10).foo.create(...)
@@ -1776,6 +1807,10 @@ class AsyncTelnyx(AsyncAPIClient):
1776
1807
 
1777
1808
  class TelnyxWithRawResponse:
1778
1809
  def __init__(self, client: Telnyx) -> None:
1810
+ self.legacy = legacy.LegacyResourceWithRawResponse(client.legacy)
1811
+ self.oauth = oauth.OAuthResourceWithRawResponse(client.oauth)
1812
+ self.oauth_clients = oauth_clients.OAuthClientsResourceWithRawResponse(client.oauth_clients)
1813
+ self.oauth_grants = oauth_grants.OAuthGrantsResourceWithRawResponse(client.oauth_grants)
1779
1814
  self.access_ip_address = access_ip_address.AccessIPAddressResourceWithRawResponse(client.access_ip_address)
1780
1815
  self.access_ip_ranges = access_ip_ranges.AccessIPRangesResourceWithRawResponse(client.access_ip_ranges)
1781
1816
  self.actions = actions.ActionsResourceWithRawResponse(client.actions)
@@ -2050,6 +2085,7 @@ class TelnyxWithRawResponse:
2050
2085
  client.wireless_blocklists
2051
2086
  )
2052
2087
  self.partner_campaigns = partner_campaigns.PartnerCampaignsResourceWithRawResponse(client.partner_campaigns)
2088
+ self.well_known = well_known.WellKnownResourceWithRawResponse(client.well_known)
2053
2089
 
2054
2090
  self.create_bucket = to_raw_response_wrapper(
2055
2091
  client.create_bucket,
@@ -2080,6 +2116,10 @@ class TelnyxWithRawResponse:
2080
2116
 
2081
2117
  class AsyncTelnyxWithRawResponse:
2082
2118
  def __init__(self, client: AsyncTelnyx) -> None:
2119
+ self.legacy = legacy.AsyncLegacyResourceWithRawResponse(client.legacy)
2120
+ self.oauth = oauth.AsyncOAuthResourceWithRawResponse(client.oauth)
2121
+ self.oauth_clients = oauth_clients.AsyncOAuthClientsResourceWithRawResponse(client.oauth_clients)
2122
+ self.oauth_grants = oauth_grants.AsyncOAuthGrantsResourceWithRawResponse(client.oauth_grants)
2083
2123
  self.access_ip_address = access_ip_address.AsyncAccessIPAddressResourceWithRawResponse(client.access_ip_address)
2084
2124
  self.access_ip_ranges = access_ip_ranges.AsyncAccessIPRangesResourceWithRawResponse(client.access_ip_ranges)
2085
2125
  self.actions = actions.AsyncActionsResourceWithRawResponse(client.actions)
@@ -2394,6 +2434,7 @@ class AsyncTelnyxWithRawResponse:
2394
2434
  self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResourceWithRawResponse(
2395
2435
  client.partner_campaigns
2396
2436
  )
2437
+ self.well_known = well_known.AsyncWellKnownResourceWithRawResponse(client.well_known)
2397
2438
 
2398
2439
  self.create_bucket = async_to_raw_response_wrapper(
2399
2440
  client.create_bucket,
@@ -2424,6 +2465,10 @@ class AsyncTelnyxWithRawResponse:
2424
2465
 
2425
2466
  class TelnyxWithStreamedResponse:
2426
2467
  def __init__(self, client: Telnyx) -> None:
2468
+ self.legacy = legacy.LegacyResourceWithStreamingResponse(client.legacy)
2469
+ self.oauth = oauth.OAuthResourceWithStreamingResponse(client.oauth)
2470
+ self.oauth_clients = oauth_clients.OAuthClientsResourceWithStreamingResponse(client.oauth_clients)
2471
+ self.oauth_grants = oauth_grants.OAuthGrantsResourceWithStreamingResponse(client.oauth_grants)
2427
2472
  self.access_ip_address = access_ip_address.AccessIPAddressResourceWithStreamingResponse(
2428
2473
  client.access_ip_address
2429
2474
  )
@@ -2744,6 +2789,7 @@ class TelnyxWithStreamedResponse:
2744
2789
  self.partner_campaigns = partner_campaigns.PartnerCampaignsResourceWithStreamingResponse(
2745
2790
  client.partner_campaigns
2746
2791
  )
2792
+ self.well_known = well_known.WellKnownResourceWithStreamingResponse(client.well_known)
2747
2793
 
2748
2794
  self.create_bucket = to_streamed_response_wrapper(
2749
2795
  client.create_bucket,
@@ -2774,6 +2820,10 @@ class TelnyxWithStreamedResponse:
2774
2820
 
2775
2821
  class AsyncTelnyxWithStreamedResponse:
2776
2822
  def __init__(self, client: AsyncTelnyx) -> None:
2823
+ self.legacy = legacy.AsyncLegacyResourceWithStreamingResponse(client.legacy)
2824
+ self.oauth = oauth.AsyncOAuthResourceWithStreamingResponse(client.oauth)
2825
+ self.oauth_clients = oauth_clients.AsyncOAuthClientsResourceWithStreamingResponse(client.oauth_clients)
2826
+ self.oauth_grants = oauth_grants.AsyncOAuthGrantsResourceWithStreamingResponse(client.oauth_grants)
2777
2827
  self.access_ip_address = access_ip_address.AsyncAccessIPAddressResourceWithStreamingResponse(
2778
2828
  client.access_ip_address
2779
2829
  )
@@ -3136,6 +3186,7 @@ class AsyncTelnyxWithStreamedResponse:
3136
3186
  self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResourceWithStreamingResponse(
3137
3187
  client.partner_campaigns
3138
3188
  )
3189
+ self.well_known = well_known.AsyncWellKnownResourceWithStreamingResponse(client.well_known)
3139
3190
 
3140
3191
  self.create_bucket = async_to_streamed_response_wrapper(
3141
3192
  client.create_bucket,
telnyx/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "telnyx"
4
- __version__ = "3.5.0-alpha" # x-release-please-version
4
+ __version__ = "3.7.0-alpha" # x-release-please-version
@@ -80,6 +80,14 @@ from .media import (
80
80
  MediaResourceWithStreamingResponse,
81
81
  AsyncMediaResourceWithStreamingResponse,
82
82
  )
83
+ from .oauth import (
84
+ OAuthResource,
85
+ AsyncOAuthResource,
86
+ OAuthResourceWithRawResponse,
87
+ AsyncOAuthResourceWithRawResponse,
88
+ OAuthResourceWithStreamingResponse,
89
+ AsyncOAuthResourceWithStreamingResponse,
90
+ )
83
91
  from .rooms import (
84
92
  RoomsResource,
85
93
  AsyncRoomsResource,
@@ -96,6 +104,14 @@ from .texml import (
96
104
  TexmlResourceWithStreamingResponse,
97
105
  AsyncTexmlResourceWithStreamingResponse,
98
106
  )
107
+ from .legacy import (
108
+ LegacyResource,
109
+ AsyncLegacyResource,
110
+ LegacyResourceWithRawResponse,
111
+ AsyncLegacyResourceWithRawResponse,
112
+ LegacyResourceWithStreamingResponse,
113
+ AsyncLegacyResourceWithStreamingResponse,
114
+ )
99
115
  from .queues import (
100
116
  QueuesResource,
101
117
  AsyncQueuesResource,
@@ -281,6 +297,14 @@ from .recordings import (
281
297
  RecordingsResourceWithStreamingResponse,
282
298
  AsyncRecordingsResourceWithStreamingResponse,
283
299
  )
300
+ from .well_known import (
301
+ WellKnownResource,
302
+ AsyncWellKnownResource,
303
+ WellKnownResourceWithRawResponse,
304
+ AsyncWellKnownResourceWithRawResponse,
305
+ WellKnownResourceWithStreamingResponse,
306
+ AsyncWellKnownResourceWithStreamingResponse,
307
+ )
284
308
  from .call_events import (
285
309
  CallEventsResource,
286
310
  AsyncCallEventsResource,
@@ -329,6 +353,14 @@ from .audit_events import (
329
353
  AuditEventsResourceWithStreamingResponse,
330
354
  AsyncAuditEventsResourceWithStreamingResponse,
331
355
  )
356
+ from .oauth_grants import (
357
+ OAuthGrantsResource,
358
+ AsyncOAuthGrantsResource,
359
+ OAuthGrantsResourceWithRawResponse,
360
+ AsyncOAuthGrantsResourceWithRawResponse,
361
+ OAuthGrantsResourceWithStreamingResponse,
362
+ AsyncOAuthGrantsResourceWithStreamingResponse,
363
+ )
332
364
  from .requirements import (
333
365
  RequirementsResource,
334
366
  AsyncRequirementsResource,
@@ -361,6 +393,14 @@ from .number_orders import (
361
393
  NumberOrdersResourceWithStreamingResponse,
362
394
  AsyncNumberOrdersResourceWithStreamingResponse,
363
395
  )
396
+ from .oauth_clients import (
397
+ OAuthClientsResource,
398
+ AsyncOAuthClientsResource,
399
+ OAuthClientsResourceWithRawResponse,
400
+ AsyncOAuthClientsResourceWithRawResponse,
401
+ OAuthClientsResourceWithStreamingResponse,
402
+ AsyncOAuthClientsResourceWithStreamingResponse,
403
+ )
364
404
  from .phone_numbers import (
365
405
  PhoneNumbersResource,
366
406
  AsyncPhoneNumbersResource,
@@ -1171,6 +1211,30 @@ from .phone_numbers_regulatory_requirements import (
1171
1211
  )
1172
1212
 
1173
1213
  __all__ = [
1214
+ "LegacyResource",
1215
+ "AsyncLegacyResource",
1216
+ "LegacyResourceWithRawResponse",
1217
+ "AsyncLegacyResourceWithRawResponse",
1218
+ "LegacyResourceWithStreamingResponse",
1219
+ "AsyncLegacyResourceWithStreamingResponse",
1220
+ "OAuthResource",
1221
+ "AsyncOAuthResource",
1222
+ "OAuthResourceWithRawResponse",
1223
+ "AsyncOAuthResourceWithRawResponse",
1224
+ "OAuthResourceWithStreamingResponse",
1225
+ "AsyncOAuthResourceWithStreamingResponse",
1226
+ "OAuthClientsResource",
1227
+ "AsyncOAuthClientsResource",
1228
+ "OAuthClientsResourceWithRawResponse",
1229
+ "AsyncOAuthClientsResourceWithRawResponse",
1230
+ "OAuthClientsResourceWithStreamingResponse",
1231
+ "AsyncOAuthClientsResourceWithStreamingResponse",
1232
+ "OAuthGrantsResource",
1233
+ "AsyncOAuthGrantsResource",
1234
+ "OAuthGrantsResourceWithRawResponse",
1235
+ "AsyncOAuthGrantsResourceWithRawResponse",
1236
+ "OAuthGrantsResourceWithStreamingResponse",
1237
+ "AsyncOAuthGrantsResourceWithStreamingResponse",
1174
1238
  "WebhooksResource",
1175
1239
  "AsyncWebhooksResource",
1176
1240
  "AccessIPAddressResource",
@@ -2049,4 +2113,10 @@ __all__ = [
2049
2113
  "AsyncPartnerCampaignsResourceWithRawResponse",
2050
2114
  "PartnerCampaignsResourceWithStreamingResponse",
2051
2115
  "AsyncPartnerCampaignsResourceWithStreamingResponse",
2116
+ "WellKnownResource",
2117
+ "AsyncWellKnownResource",
2118
+ "WellKnownResourceWithRawResponse",
2119
+ "AsyncWellKnownResourceWithRawResponse",
2120
+ "WellKnownResourceWithStreamingResponse",
2121
+ "AsyncWellKnownResourceWithStreamingResponse",
2052
2122
  ]
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict
5
+ from typing import Dict, Union, Iterable
6
+ from datetime import datetime
6
7
 
7
8
  import httpx
8
9
 
@@ -22,10 +23,15 @@ from .messages import (
22
23
  MessagesResourceWithStreamingResponse,
23
24
  AsyncMessagesResourceWithStreamingResponse,
24
25
  )
25
- from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
26
+ from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
26
27
  from ...._utils import maybe_transform, async_maybe_transform
27
28
  from ...._compat import cached_property
28
- from ....types.ai import conversation_list_params, conversation_create_params, conversation_update_params
29
+ from ....types.ai import (
30
+ conversation_list_params,
31
+ conversation_create_params,
32
+ conversation_update_params,
33
+ conversation_add_message_params,
34
+ )
29
35
  from ...._resource import SyncAPIResource, AsyncAPIResource
30
36
  from ...._response import (
31
37
  to_raw_response_wrapper,
@@ -326,6 +332,64 @@ class ConversationsResource(SyncAPIResource):
326
332
  cast_to=NoneType,
327
333
  )
328
334
 
335
+ def add_message(
336
+ self,
337
+ conversation_id: str,
338
+ *,
339
+ role: str,
340
+ content: str | Omit = omit,
341
+ metadata: Dict[str, Union[str, int, bool, SequenceNotStr[Union[str, int, bool]]]] | Omit = omit,
342
+ name: str | Omit = omit,
343
+ sent_at: Union[str, datetime] | Omit = omit,
344
+ tool_call_id: str | Omit = omit,
345
+ tool_calls: Iterable[Dict[str, object]] | Omit = omit,
346
+ tool_choice: Union[str, object] | Omit = omit,
347
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
348
+ # The extra values given here take precedence over values defined on the client or passed to this method.
349
+ extra_headers: Headers | None = None,
350
+ extra_query: Query | None = None,
351
+ extra_body: Body | None = None,
352
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
353
+ ) -> object:
354
+ """Add a new message to the conversation.
355
+
356
+ Used to insert a new messages to a
357
+ conversation manually ( without using chat endpoint )
358
+
359
+ Args:
360
+ conversation_id: The ID of the conversation
361
+
362
+ extra_headers: Send extra headers
363
+
364
+ extra_query: Add additional query parameters to the request
365
+
366
+ extra_body: Add additional JSON properties to the request
367
+
368
+ timeout: Override the client-level default timeout for this request, in seconds
369
+ """
370
+ if not conversation_id:
371
+ raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
372
+ return self._post(
373
+ f"/ai/conversations/{conversation_id}/message",
374
+ body=maybe_transform(
375
+ {
376
+ "role": role,
377
+ "content": content,
378
+ "metadata": metadata,
379
+ "name": name,
380
+ "sent_at": sent_at,
381
+ "tool_call_id": tool_call_id,
382
+ "tool_calls": tool_calls,
383
+ "tool_choice": tool_choice,
384
+ },
385
+ conversation_add_message_params.ConversationAddMessageParams,
386
+ ),
387
+ options=make_request_options(
388
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
389
+ ),
390
+ cast_to=object,
391
+ )
392
+
329
393
  def retrieve_conversations_insights(
330
394
  self,
331
395
  conversation_id: str,
@@ -635,6 +699,64 @@ class AsyncConversationsResource(AsyncAPIResource):
635
699
  cast_to=NoneType,
636
700
  )
637
701
 
702
+ async def add_message(
703
+ self,
704
+ conversation_id: str,
705
+ *,
706
+ role: str,
707
+ content: str | Omit = omit,
708
+ metadata: Dict[str, Union[str, int, bool, SequenceNotStr[Union[str, int, bool]]]] | Omit = omit,
709
+ name: str | Omit = omit,
710
+ sent_at: Union[str, datetime] | Omit = omit,
711
+ tool_call_id: str | Omit = omit,
712
+ tool_calls: Iterable[Dict[str, object]] | Omit = omit,
713
+ tool_choice: Union[str, object] | Omit = omit,
714
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
715
+ # The extra values given here take precedence over values defined on the client or passed to this method.
716
+ extra_headers: Headers | None = None,
717
+ extra_query: Query | None = None,
718
+ extra_body: Body | None = None,
719
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
720
+ ) -> object:
721
+ """Add a new message to the conversation.
722
+
723
+ Used to insert a new messages to a
724
+ conversation manually ( without using chat endpoint )
725
+
726
+ Args:
727
+ conversation_id: The ID of the conversation
728
+
729
+ extra_headers: Send extra headers
730
+
731
+ extra_query: Add additional query parameters to the request
732
+
733
+ extra_body: Add additional JSON properties to the request
734
+
735
+ timeout: Override the client-level default timeout for this request, in seconds
736
+ """
737
+ if not conversation_id:
738
+ raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
739
+ return await self._post(
740
+ f"/ai/conversations/{conversation_id}/message",
741
+ body=await async_maybe_transform(
742
+ {
743
+ "role": role,
744
+ "content": content,
745
+ "metadata": metadata,
746
+ "name": name,
747
+ "sent_at": sent_at,
748
+ "tool_call_id": tool_call_id,
749
+ "tool_calls": tool_calls,
750
+ "tool_choice": tool_choice,
751
+ },
752
+ conversation_add_message_params.ConversationAddMessageParams,
753
+ ),
754
+ options=make_request_options(
755
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
756
+ ),
757
+ cast_to=object,
758
+ )
759
+
638
760
  async def retrieve_conversations_insights(
639
761
  self,
640
762
  conversation_id: str,
@@ -688,6 +810,9 @@ class ConversationsResourceWithRawResponse:
688
810
  self.delete = to_raw_response_wrapper(
689
811
  conversations.delete,
690
812
  )
813
+ self.add_message = to_raw_response_wrapper(
814
+ conversations.add_message,
815
+ )
691
816
  self.retrieve_conversations_insights = to_raw_response_wrapper(
692
817
  conversations.retrieve_conversations_insights,
693
818
  )
@@ -724,6 +849,9 @@ class AsyncConversationsResourceWithRawResponse:
724
849
  self.delete = async_to_raw_response_wrapper(
725
850
  conversations.delete,
726
851
  )
852
+ self.add_message = async_to_raw_response_wrapper(
853
+ conversations.add_message,
854
+ )
727
855
  self.retrieve_conversations_insights = async_to_raw_response_wrapper(
728
856
  conversations.retrieve_conversations_insights,
729
857
  )
@@ -760,6 +888,9 @@ class ConversationsResourceWithStreamingResponse:
760
888
  self.delete = to_streamed_response_wrapper(
761
889
  conversations.delete,
762
890
  )
891
+ self.add_message = to_streamed_response_wrapper(
892
+ conversations.add_message,
893
+ )
763
894
  self.retrieve_conversations_insights = to_streamed_response_wrapper(
764
895
  conversations.retrieve_conversations_insights,
765
896
  )
@@ -796,6 +927,9 @@ class AsyncConversationsResourceWithStreamingResponse:
796
927
  self.delete = async_to_streamed_response_wrapper(
797
928
  conversations.delete,
798
929
  )
930
+ self.add_message = async_to_streamed_response_wrapper(
931
+ conversations.add_message,
932
+ )
799
933
  self.retrieve_conversations_insights = async_to_streamed_response_wrapper(
800
934
  conversations.retrieve_conversations_insights,
801
935
  )