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
@@ -0,0 +1,349 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..types import oauth_grant_list_params
8
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9
+ from .._utils import maybe_transform, async_maybe_transform
10
+ from .._compat import cached_property
11
+ from .._resource import SyncAPIResource, AsyncAPIResource
12
+ from .._response import (
13
+ to_raw_response_wrapper,
14
+ to_streamed_response_wrapper,
15
+ async_to_raw_response_wrapper,
16
+ async_to_streamed_response_wrapper,
17
+ )
18
+ from .._base_client import make_request_options
19
+ from ..types.oauth_grant_list_response import OAuthGrantListResponse
20
+ from ..types.oauth_grant_delete_response import OAuthGrantDeleteResponse
21
+ from ..types.oauth_grant_retrieve_response import OAuthGrantRetrieveResponse
22
+
23
+ __all__ = ["OAuthGrantsResource", "AsyncOAuthGrantsResource"]
24
+
25
+
26
+ class OAuthGrantsResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> OAuthGrantsResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
34
+ """
35
+ return OAuthGrantsResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> OAuthGrantsResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
43
+ """
44
+ return OAuthGrantsResourceWithStreamingResponse(self)
45
+
46
+ def retrieve(
47
+ self,
48
+ id: str,
49
+ *,
50
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
+ # The extra values given here take precedence over values defined on the client or passed to this method.
52
+ extra_headers: Headers | None = None,
53
+ extra_query: Query | None = None,
54
+ extra_body: Body | None = None,
55
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
56
+ ) -> OAuthGrantRetrieveResponse:
57
+ """
58
+ Retrieve a single OAuth grant by ID
59
+
60
+ Args:
61
+ extra_headers: Send extra headers
62
+
63
+ extra_query: Add additional query parameters to the request
64
+
65
+ extra_body: Add additional JSON properties to the request
66
+
67
+ timeout: Override the client-level default timeout for this request, in seconds
68
+ """
69
+ if not id:
70
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
71
+ return self._get(
72
+ f"/oauth_grants/{id}",
73
+ options=make_request_options(
74
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
75
+ ),
76
+ cast_to=OAuthGrantRetrieveResponse,
77
+ )
78
+
79
+ def list(
80
+ self,
81
+ *,
82
+ page_number: int | Omit = omit,
83
+ page_size: int | Omit = omit,
84
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
85
+ # The extra values given here take precedence over values defined on the client or passed to this method.
86
+ extra_headers: Headers | None = None,
87
+ extra_query: Query | None = None,
88
+ extra_body: Body | None = None,
89
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
90
+ ) -> OAuthGrantListResponse:
91
+ """
92
+ Retrieve a paginated list of OAuth grants for the authenticated user
93
+
94
+ Args:
95
+ page_number: Page number
96
+
97
+ page_size: Number of results per page
98
+
99
+ extra_headers: Send extra headers
100
+
101
+ extra_query: Add additional query parameters to the request
102
+
103
+ extra_body: Add additional JSON properties to the request
104
+
105
+ timeout: Override the client-level default timeout for this request, in seconds
106
+ """
107
+ return self._get(
108
+ "/oauth_grants",
109
+ options=make_request_options(
110
+ extra_headers=extra_headers,
111
+ extra_query=extra_query,
112
+ extra_body=extra_body,
113
+ timeout=timeout,
114
+ query=maybe_transform(
115
+ {
116
+ "page_number": page_number,
117
+ "page_size": page_size,
118
+ },
119
+ oauth_grant_list_params.OAuthGrantListParams,
120
+ ),
121
+ ),
122
+ cast_to=OAuthGrantListResponse,
123
+ )
124
+
125
+ def delete(
126
+ self,
127
+ id: str,
128
+ *,
129
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130
+ # The extra values given here take precedence over values defined on the client or passed to this method.
131
+ extra_headers: Headers | None = None,
132
+ extra_query: Query | None = None,
133
+ extra_body: Body | None = None,
134
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
135
+ ) -> OAuthGrantDeleteResponse:
136
+ """
137
+ Revoke an OAuth grant
138
+
139
+ Args:
140
+ extra_headers: Send extra headers
141
+
142
+ extra_query: Add additional query parameters to the request
143
+
144
+ extra_body: Add additional JSON properties to the request
145
+
146
+ timeout: Override the client-level default timeout for this request, in seconds
147
+ """
148
+ if not id:
149
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
150
+ return self._delete(
151
+ f"/oauth_grants/{id}",
152
+ options=make_request_options(
153
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
154
+ ),
155
+ cast_to=OAuthGrantDeleteResponse,
156
+ )
157
+
158
+
159
+ class AsyncOAuthGrantsResource(AsyncAPIResource):
160
+ @cached_property
161
+ def with_raw_response(self) -> AsyncOAuthGrantsResourceWithRawResponse:
162
+ """
163
+ This property can be used as a prefix for any HTTP method call to return
164
+ the raw response object instead of the parsed content.
165
+
166
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
167
+ """
168
+ return AsyncOAuthGrantsResourceWithRawResponse(self)
169
+
170
+ @cached_property
171
+ def with_streaming_response(self) -> AsyncOAuthGrantsResourceWithStreamingResponse:
172
+ """
173
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
174
+
175
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
176
+ """
177
+ return AsyncOAuthGrantsResourceWithStreamingResponse(self)
178
+
179
+ async def retrieve(
180
+ self,
181
+ id: str,
182
+ *,
183
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
184
+ # The extra values given here take precedence over values defined on the client or passed to this method.
185
+ extra_headers: Headers | None = None,
186
+ extra_query: Query | None = None,
187
+ extra_body: Body | None = None,
188
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
189
+ ) -> OAuthGrantRetrieveResponse:
190
+ """
191
+ Retrieve a single OAuth grant by ID
192
+
193
+ Args:
194
+ extra_headers: Send extra headers
195
+
196
+ extra_query: Add additional query parameters to the request
197
+
198
+ extra_body: Add additional JSON properties to the request
199
+
200
+ timeout: Override the client-level default timeout for this request, in seconds
201
+ """
202
+ if not id:
203
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
204
+ return await self._get(
205
+ f"/oauth_grants/{id}",
206
+ options=make_request_options(
207
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
208
+ ),
209
+ cast_to=OAuthGrantRetrieveResponse,
210
+ )
211
+
212
+ async def list(
213
+ self,
214
+ *,
215
+ page_number: int | Omit = omit,
216
+ page_size: int | Omit = omit,
217
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218
+ # The extra values given here take precedence over values defined on the client or passed to this method.
219
+ extra_headers: Headers | None = None,
220
+ extra_query: Query | None = None,
221
+ extra_body: Body | None = None,
222
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
223
+ ) -> OAuthGrantListResponse:
224
+ """
225
+ Retrieve a paginated list of OAuth grants for the authenticated user
226
+
227
+ Args:
228
+ page_number: Page number
229
+
230
+ page_size: Number of results per page
231
+
232
+ extra_headers: Send extra headers
233
+
234
+ extra_query: Add additional query parameters to the request
235
+
236
+ extra_body: Add additional JSON properties to the request
237
+
238
+ timeout: Override the client-level default timeout for this request, in seconds
239
+ """
240
+ return await self._get(
241
+ "/oauth_grants",
242
+ options=make_request_options(
243
+ extra_headers=extra_headers,
244
+ extra_query=extra_query,
245
+ extra_body=extra_body,
246
+ timeout=timeout,
247
+ query=await async_maybe_transform(
248
+ {
249
+ "page_number": page_number,
250
+ "page_size": page_size,
251
+ },
252
+ oauth_grant_list_params.OAuthGrantListParams,
253
+ ),
254
+ ),
255
+ cast_to=OAuthGrantListResponse,
256
+ )
257
+
258
+ async def delete(
259
+ self,
260
+ id: str,
261
+ *,
262
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
263
+ # The extra values given here take precedence over values defined on the client or passed to this method.
264
+ extra_headers: Headers | None = None,
265
+ extra_query: Query | None = None,
266
+ extra_body: Body | None = None,
267
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
268
+ ) -> OAuthGrantDeleteResponse:
269
+ """
270
+ Revoke an OAuth grant
271
+
272
+ Args:
273
+ extra_headers: Send extra headers
274
+
275
+ extra_query: Add additional query parameters to the request
276
+
277
+ extra_body: Add additional JSON properties to the request
278
+
279
+ timeout: Override the client-level default timeout for this request, in seconds
280
+ """
281
+ if not id:
282
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
283
+ return await self._delete(
284
+ f"/oauth_grants/{id}",
285
+ options=make_request_options(
286
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
287
+ ),
288
+ cast_to=OAuthGrantDeleteResponse,
289
+ )
290
+
291
+
292
+ class OAuthGrantsResourceWithRawResponse:
293
+ def __init__(self, oauth_grants: OAuthGrantsResource) -> None:
294
+ self._oauth_grants = oauth_grants
295
+
296
+ self.retrieve = to_raw_response_wrapper(
297
+ oauth_grants.retrieve,
298
+ )
299
+ self.list = to_raw_response_wrapper(
300
+ oauth_grants.list,
301
+ )
302
+ self.delete = to_raw_response_wrapper(
303
+ oauth_grants.delete,
304
+ )
305
+
306
+
307
+ class AsyncOAuthGrantsResourceWithRawResponse:
308
+ def __init__(self, oauth_grants: AsyncOAuthGrantsResource) -> None:
309
+ self._oauth_grants = oauth_grants
310
+
311
+ self.retrieve = async_to_raw_response_wrapper(
312
+ oauth_grants.retrieve,
313
+ )
314
+ self.list = async_to_raw_response_wrapper(
315
+ oauth_grants.list,
316
+ )
317
+ self.delete = async_to_raw_response_wrapper(
318
+ oauth_grants.delete,
319
+ )
320
+
321
+
322
+ class OAuthGrantsResourceWithStreamingResponse:
323
+ def __init__(self, oauth_grants: OAuthGrantsResource) -> None:
324
+ self._oauth_grants = oauth_grants
325
+
326
+ self.retrieve = to_streamed_response_wrapper(
327
+ oauth_grants.retrieve,
328
+ )
329
+ self.list = to_streamed_response_wrapper(
330
+ oauth_grants.list,
331
+ )
332
+ self.delete = to_streamed_response_wrapper(
333
+ oauth_grants.delete,
334
+ )
335
+
336
+
337
+ class AsyncOAuthGrantsResourceWithStreamingResponse:
338
+ def __init__(self, oauth_grants: AsyncOAuthGrantsResource) -> None:
339
+ self._oauth_grants = oauth_grants
340
+
341
+ self.retrieve = async_to_streamed_response_wrapper(
342
+ oauth_grants.retrieve,
343
+ )
344
+ self.list = async_to_streamed_response_wrapper(
345
+ oauth_grants.list,
346
+ )
347
+ self.delete = async_to_streamed_response_wrapper(
348
+ oauth_grants.delete,
349
+ )
@@ -65,6 +65,7 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
65
65
  name: str,
66
66
  billing_group_id: Optional[str] | Omit = omit,
67
67
  call_recording: OutboundCallRecordingParam | Omit = omit,
68
+ calling_window: outbound_voice_profile_create_params.CallingWindow | Omit = omit,
68
69
  concurrent_call_limit: Optional[int] | Omit = omit,
69
70
  daily_spend_limit: str | Omit = omit,
70
71
  daily_spend_limit_enabled: bool | Omit = omit,
@@ -91,6 +92,9 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
91
92
  billing_group_id: The ID of the billing group associated with the outbound proflile. Defaults to
92
93
  null (for no group assigned).
93
94
 
95
+ calling_window: (BETA) Specifies the time window and call limits for calls made using this
96
+ outbound voice profile. Note that all times are UTC in 24-hour clock time.
97
+
94
98
  concurrent_call_limit: Must be no more than your global concurrent call limit. Null means no limit.
95
99
 
96
100
  daily_spend_limit: The maximum amount of usage charges, in USD, you want Telnyx to allow on this
@@ -129,6 +133,7 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
129
133
  "name": name,
130
134
  "billing_group_id": billing_group_id,
131
135
  "call_recording": call_recording,
136
+ "calling_window": calling_window,
132
137
  "concurrent_call_limit": concurrent_call_limit,
133
138
  "daily_spend_limit": daily_spend_limit,
134
139
  "daily_spend_limit_enabled": daily_spend_limit_enabled,
@@ -188,6 +193,7 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
188
193
  name: str,
189
194
  billing_group_id: Optional[str] | Omit = omit,
190
195
  call_recording: OutboundCallRecordingParam | Omit = omit,
196
+ calling_window: outbound_voice_profile_update_params.CallingWindow | Omit = omit,
191
197
  concurrent_call_limit: Optional[int] | Omit = omit,
192
198
  daily_spend_limit: str | Omit = omit,
193
199
  daily_spend_limit_enabled: bool | Omit = omit,
@@ -214,6 +220,9 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
214
220
  billing_group_id: The ID of the billing group associated with the outbound proflile. Defaults to
215
221
  null (for no group assigned).
216
222
 
223
+ calling_window: (BETA) Specifies the time window and call limits for calls made using this
224
+ outbound voice profile.
225
+
217
226
  concurrent_call_limit: Must be no more than your global concurrent call limit. Null means no limit.
218
227
 
219
228
  daily_spend_limit: The maximum amount of usage charges, in USD, you want Telnyx to allow on this
@@ -254,6 +263,7 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
254
263
  "name": name,
255
264
  "billing_group_id": billing_group_id,
256
265
  "call_recording": call_recording,
266
+ "calling_window": calling_window,
257
267
  "concurrent_call_limit": concurrent_call_limit,
258
268
  "daily_spend_limit": daily_spend_limit,
259
269
  "daily_spend_limit_enabled": daily_spend_limit_enabled,
@@ -309,8 +319,8 @@ class OutboundVoiceProfilesResource(SyncAPIResource):
309
319
  Consolidated filter parameter (deepObject style). Originally:
310
320
  filter[name][contains]
311
321
 
312
- page: Consolidated page parameter (deepObject style). Originally: page[number],
313
- page[size]
322
+ page: Consolidated page parameter (deepObject style). Originally: page[size],
323
+ page[number]
314
324
 
315
325
  sort: Specifies the sort order for results. By default sorting direction is ascending.
316
326
  To have the results sorted in descending order add the <code>-</code>
@@ -414,6 +424,7 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
414
424
  name: str,
415
425
  billing_group_id: Optional[str] | Omit = omit,
416
426
  call_recording: OutboundCallRecordingParam | Omit = omit,
427
+ calling_window: outbound_voice_profile_create_params.CallingWindow | Omit = omit,
417
428
  concurrent_call_limit: Optional[int] | Omit = omit,
418
429
  daily_spend_limit: str | Omit = omit,
419
430
  daily_spend_limit_enabled: bool | Omit = omit,
@@ -440,6 +451,9 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
440
451
  billing_group_id: The ID of the billing group associated with the outbound proflile. Defaults to
441
452
  null (for no group assigned).
442
453
 
454
+ calling_window: (BETA) Specifies the time window and call limits for calls made using this
455
+ outbound voice profile. Note that all times are UTC in 24-hour clock time.
456
+
443
457
  concurrent_call_limit: Must be no more than your global concurrent call limit. Null means no limit.
444
458
 
445
459
  daily_spend_limit: The maximum amount of usage charges, in USD, you want Telnyx to allow on this
@@ -478,6 +492,7 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
478
492
  "name": name,
479
493
  "billing_group_id": billing_group_id,
480
494
  "call_recording": call_recording,
495
+ "calling_window": calling_window,
481
496
  "concurrent_call_limit": concurrent_call_limit,
482
497
  "daily_spend_limit": daily_spend_limit,
483
498
  "daily_spend_limit_enabled": daily_spend_limit_enabled,
@@ -537,6 +552,7 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
537
552
  name: str,
538
553
  billing_group_id: Optional[str] | Omit = omit,
539
554
  call_recording: OutboundCallRecordingParam | Omit = omit,
555
+ calling_window: outbound_voice_profile_update_params.CallingWindow | Omit = omit,
540
556
  concurrent_call_limit: Optional[int] | Omit = omit,
541
557
  daily_spend_limit: str | Omit = omit,
542
558
  daily_spend_limit_enabled: bool | Omit = omit,
@@ -563,6 +579,9 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
563
579
  billing_group_id: The ID of the billing group associated with the outbound proflile. Defaults to
564
580
  null (for no group assigned).
565
581
 
582
+ calling_window: (BETA) Specifies the time window and call limits for calls made using this
583
+ outbound voice profile.
584
+
566
585
  concurrent_call_limit: Must be no more than your global concurrent call limit. Null means no limit.
567
586
 
568
587
  daily_spend_limit: The maximum amount of usage charges, in USD, you want Telnyx to allow on this
@@ -603,6 +622,7 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
603
622
  "name": name,
604
623
  "billing_group_id": billing_group_id,
605
624
  "call_recording": call_recording,
625
+ "calling_window": calling_window,
606
626
  "concurrent_call_limit": concurrent_call_limit,
607
627
  "daily_spend_limit": daily_spend_limit,
608
628
  "daily_spend_limit_enabled": daily_spend_limit_enabled,
@@ -658,8 +678,8 @@ class AsyncOutboundVoiceProfilesResource(AsyncAPIResource):
658
678
  Consolidated filter parameter (deepObject style). Originally:
659
679
  filter[name][contains]
660
680
 
661
- page: Consolidated page parameter (deepObject style). Originally: page[number],
662
- page[size]
681
+ page: Consolidated page parameter (deepObject style). Originally: page[size],
682
+ page[number]
663
683
 
664
684
  sort: Specifies the sort order for results. By default sorting direction is ascending.
665
685
  To have the results sorted in descending order add the <code>-</code>
@@ -181,6 +181,7 @@ class JobsResource(SyncAPIResource):
181
181
  billing_group_id: str | Omit = omit,
182
182
  connection_id: str | Omit = omit,
183
183
  customer_reference: str | Omit = omit,
184
+ deletion_lock_enabled: bool | Omit = omit,
184
185
  external_pin: str | Omit = omit,
185
186
  hd_voice_enabled: bool | Omit = omit,
186
187
  tags: SequenceNotStr[str] | Omit = omit,
@@ -224,6 +225,10 @@ class JobsResource(SyncAPIResource):
224
225
 
225
226
  customer_reference: A customer reference string for customer look ups.
226
227
 
228
+ deletion_lock_enabled: Indicates whether to enable or disable the deletion lock on each phone number.
229
+ When enabled, this prevents the phone number from being deleted via the API or
230
+ Telnyx portal.
231
+
227
232
  external_pin: If someone attempts to port your phone number away from Telnyx and your phone
228
233
  number has an external PIN set, we will attempt to verify that you provided the
229
234
  correct external PIN to the winning carrier. Note that not all carriers
@@ -251,6 +256,7 @@ class JobsResource(SyncAPIResource):
251
256
  "billing_group_id": billing_group_id,
252
257
  "connection_id": connection_id,
253
258
  "customer_reference": customer_reference,
259
+ "deletion_lock_enabled": deletion_lock_enabled,
254
260
  "external_pin": external_pin,
255
261
  "hd_voice_enabled": hd_voice_enabled,
256
262
  "tags": tags,
@@ -466,6 +472,7 @@ class AsyncJobsResource(AsyncAPIResource):
466
472
  billing_group_id: str | Omit = omit,
467
473
  connection_id: str | Omit = omit,
468
474
  customer_reference: str | Omit = omit,
475
+ deletion_lock_enabled: bool | Omit = omit,
469
476
  external_pin: str | Omit = omit,
470
477
  hd_voice_enabled: bool | Omit = omit,
471
478
  tags: SequenceNotStr[str] | Omit = omit,
@@ -509,6 +516,10 @@ class AsyncJobsResource(AsyncAPIResource):
509
516
 
510
517
  customer_reference: A customer reference string for customer look ups.
511
518
 
519
+ deletion_lock_enabled: Indicates whether to enable or disable the deletion lock on each phone number.
520
+ When enabled, this prevents the phone number from being deleted via the API or
521
+ Telnyx portal.
522
+
512
523
  external_pin: If someone attempts to port your phone number away from Telnyx and your phone
513
524
  number has an external PIN set, we will attempt to verify that you provided the
514
525
  correct external PIN to the winning carrier. Note that not all carriers
@@ -536,6 +547,7 @@ class AsyncJobsResource(AsyncAPIResource):
536
547
  "billing_group_id": billing_group_id,
537
548
  "connection_id": connection_id,
538
549
  "customer_reference": customer_reference,
550
+ "deletion_lock_enabled": deletion_lock_enabled,
539
551
  "external_pin": external_pin,
540
552
  "hd_voice_enabled": hd_voice_enabled,
541
553
  "tags": tags,
@@ -194,6 +194,7 @@ class PortingOrdersResource(SyncAPIResource):
194
194
  self,
195
195
  *,
196
196
  phone_numbers: SequenceNotStr[str],
197
+ customer_group_reference: str | Omit = omit,
197
198
  customer_reference: str | Omit = omit,
198
199
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
199
200
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -208,6 +209,8 @@ class PortingOrdersResource(SyncAPIResource):
208
209
  Args:
209
210
  phone_numbers: The list of +E.164 formatted phone numbers
210
211
 
212
+ customer_group_reference: A customer-specified group reference for customer bookkeeping purposes
213
+
211
214
  customer_reference: A customer-specified reference number for customer bookkeeping purposes
212
215
 
213
216
  extra_headers: Send extra headers
@@ -223,6 +226,7 @@ class PortingOrdersResource(SyncAPIResource):
223
226
  body=maybe_transform(
224
227
  {
225
228
  "phone_numbers": phone_numbers,
229
+ "customer_group_reference": customer_group_reference,
226
230
  "customer_reference": customer_reference,
227
231
  },
228
232
  porting_order_create_params.PortingOrderCreateParams,
@@ -281,6 +285,7 @@ class PortingOrdersResource(SyncAPIResource):
281
285
  id: str,
282
286
  *,
283
287
  activation_settings: porting_order_update_params.ActivationSettings | Omit = omit,
288
+ customer_group_reference: str | Omit = omit,
284
289
  customer_reference: str | Omit = omit,
285
290
  documents: PortingOrderDocumentsParam | Omit = omit,
286
291
  end_user: PortingOrderEndUserParam | Omit = omit,
@@ -335,6 +340,7 @@ class PortingOrdersResource(SyncAPIResource):
335
340
  body=maybe_transform(
336
341
  {
337
342
  "activation_settings": activation_settings,
343
+ "customer_group_reference": customer_group_reference,
338
344
  "customer_reference": customer_reference,
339
345
  "documents": documents,
340
346
  "end_user": end_user,
@@ -374,10 +380,10 @@ class PortingOrdersResource(SyncAPIResource):
374
380
  Args:
375
381
  filter:
376
382
  Consolidated filter parameter (deepObject style). Originally:
377
- filter[customer_reference], filter[parent_support_key],
378
- filter[phone_numbers.country_code], filter[phone_numbers.carrier_name],
379
- filter[misc.type], filter[end_user.admin.entity_name],
380
- filter[end_user.admin.auth_person_name],
383
+ filter[customer_reference], filter[customer_group_reference],
384
+ filter[parent_support_key], filter[phone_numbers.country_code],
385
+ filter[phone_numbers.carrier_name], filter[misc.type],
386
+ filter[end_user.admin.entity_name], filter[end_user.admin.auth_person_name],
381
387
  filter[activation_settings.fast_port_eligible],
382
388
  filter[activation_settings.foc_datetime_requested][gt],
383
389
  filter[activation_settings.foc_datetime_requested][lt],
@@ -693,6 +699,7 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
693
699
  self,
694
700
  *,
695
701
  phone_numbers: SequenceNotStr[str],
702
+ customer_group_reference: str | Omit = omit,
696
703
  customer_reference: str | Omit = omit,
697
704
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
698
705
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -707,6 +714,8 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
707
714
  Args:
708
715
  phone_numbers: The list of +E.164 formatted phone numbers
709
716
 
717
+ customer_group_reference: A customer-specified group reference for customer bookkeeping purposes
718
+
710
719
  customer_reference: A customer-specified reference number for customer bookkeeping purposes
711
720
 
712
721
  extra_headers: Send extra headers
@@ -722,6 +731,7 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
722
731
  body=await async_maybe_transform(
723
732
  {
724
733
  "phone_numbers": phone_numbers,
734
+ "customer_group_reference": customer_group_reference,
725
735
  "customer_reference": customer_reference,
726
736
  },
727
737
  porting_order_create_params.PortingOrderCreateParams,
@@ -780,6 +790,7 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
780
790
  id: str,
781
791
  *,
782
792
  activation_settings: porting_order_update_params.ActivationSettings | Omit = omit,
793
+ customer_group_reference: str | Omit = omit,
783
794
  customer_reference: str | Omit = omit,
784
795
  documents: PortingOrderDocumentsParam | Omit = omit,
785
796
  end_user: PortingOrderEndUserParam | Omit = omit,
@@ -834,6 +845,7 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
834
845
  body=await async_maybe_transform(
835
846
  {
836
847
  "activation_settings": activation_settings,
848
+ "customer_group_reference": customer_group_reference,
837
849
  "customer_reference": customer_reference,
838
850
  "documents": documents,
839
851
  "end_user": end_user,
@@ -873,10 +885,10 @@ class AsyncPortingOrdersResource(AsyncAPIResource):
873
885
  Args:
874
886
  filter:
875
887
  Consolidated filter parameter (deepObject style). Originally:
876
- filter[customer_reference], filter[parent_support_key],
877
- filter[phone_numbers.country_code], filter[phone_numbers.carrier_name],
878
- filter[misc.type], filter[end_user.admin.entity_name],
879
- filter[end_user.admin.auth_person_name],
888
+ filter[customer_reference], filter[customer_group_reference],
889
+ filter[parent_support_key], filter[phone_numbers.country_code],
890
+ filter[phone_numbers.carrier_name], filter[misc.type],
891
+ filter[end_user.admin.entity_name], filter[end_user.admin.auth_person_name],
880
892
  filter[activation_settings.fast_port_eligible],
881
893
  filter[activation_settings.foc_datetime_requested][gt],
882
894
  filter[activation_settings.foc_datetime_requested][lt],