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.
- telnyx/_client.py +53 -2
- telnyx/_version.py +1 -1
- telnyx/resources/__init__.py +70 -0
- telnyx/resources/ai/conversations/conversations.py +137 -3
- telnyx/resources/ai/conversations/messages.py +1 -134
- telnyx/resources/calls/actions.py +146 -146
- telnyx/resources/calls/calls.py +4 -10
- telnyx/resources/conferences/actions.py +8 -24
- telnyx/resources/conferences/conferences.py +2 -6
- telnyx/resources/legacy/__init__.py +33 -0
- telnyx/resources/legacy/legacy.py +102 -0
- telnyx/resources/legacy/reporting/__init__.py +47 -0
- telnyx/resources/legacy/reporting/batch_detail_records/__init__.py +61 -0
- telnyx/resources/legacy/reporting/batch_detail_records/batch_detail_records.py +166 -0
- telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +481 -0
- telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
- telnyx/resources/legacy/reporting/batch_detail_records/voice.py +538 -0
- telnyx/resources/legacy/reporting/reporting.py +134 -0
- telnyx/resources/legacy/reporting/usage_reports/__init__.py +61 -0
- telnyx/resources/legacy/reporting/usage_reports/messaging.py +471 -0
- telnyx/resources/legacy/reporting/usage_reports/number_lookup.py +464 -0
- telnyx/resources/legacy/reporting/usage_reports/usage_reports.py +288 -0
- telnyx/resources/legacy/reporting/usage_reports/voice.py +493 -0
- telnyx/resources/oauth.py +855 -0
- telnyx/resources/oauth_clients.py +711 -0
- telnyx/resources/oauth_grants.py +349 -0
- telnyx/resources/phone_numbers/jobs.py +12 -0
- telnyx/resources/porting_orders/porting_orders.py +20 -8
- telnyx/resources/sim_cards/sim_cards.py +3 -2
- telnyx/resources/verifications/verifications.py +10 -0
- telnyx/resources/verify_profiles.py +183 -1
- telnyx/resources/well_known.py +198 -0
- telnyx/types/__init__.py +41 -1
- telnyx/types/addresses/action_validate_response.py +2 -2
- telnyx/types/ai/__init__.py +1 -0
- telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
- telnyx/types/ai/conversations/__init__.py +0 -1
- telnyx/types/ai/inference_embedding_webhook_tool_params.py +2 -0
- telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +2 -0
- telnyx/types/{error.py → api_error.py} +2 -2
- telnyx/types/call_dial_params.py +2 -3
- telnyx/types/calls/action_answer_params.py +1 -2
- telnyx/types/calls/action_gather_using_ai_params.py +5 -8
- telnyx/types/calls/action_start_streaming_params.py +4 -2
- telnyx/types/calls/action_transfer_params.py +50 -0
- telnyx/types/campaign_submit_appeal_response.py +0 -3
- telnyx/types/legacy/__init__.py +3 -0
- telnyx/types/legacy/reporting/__init__.py +10 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +20 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +77 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +80 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_params.py +19 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +79 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +91 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +91 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +102 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_fields_response.py +23 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +91 -0
- telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_params.py +17 -0
- telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_response.py +11 -0
- telnyx/types/legacy/reporting/usage_reports/__init__.py +18 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_params.py +29 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +54 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/number_lookup_create_params.py +26 -0
- telnyx/types/legacy/reporting/usage_reports/number_lookup_list_params.py +13 -0
- telnyx/types/legacy/reporting/usage_reports/voice_create_params.py +40 -0
- telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +48 -0
- telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +48 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +59 -0
- telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +48 -0
- telnyx/types/number_order_status_update_webhook_event.py +30 -4
- telnyx/types/oauth_client_create_params.py +39 -0
- telnyx/types/oauth_client_create_response.py +63 -0
- telnyx/types/oauth_client_list_params.py +38 -0
- telnyx/types/oauth_client_list_response.py +79 -0
- telnyx/types/oauth_client_retrieve_response.py +63 -0
- telnyx/types/oauth_client_update_params.py +36 -0
- telnyx/types/oauth_client_update_response.py +63 -0
- telnyx/types/oauth_grant_delete_response.py +33 -0
- telnyx/types/oauth_grant_list_params.py +17 -0
- telnyx/types/oauth_grant_list_response.py +49 -0
- telnyx/types/oauth_grant_retrieve_response.py +33 -0
- telnyx/types/oauth_grants_params.py +15 -0
- telnyx/types/oauth_grants_response.py +10 -0
- telnyx/types/oauth_introspect_params.py +12 -0
- telnyx/types/oauth_introspect_response.py +30 -0
- telnyx/types/oauth_register_params.py +39 -0
- telnyx/types/oauth_register_response.py +45 -0
- telnyx/types/oauth_retrieve_authorize_params.py +30 -0
- telnyx/types/oauth_retrieve_jwks_response.py +25 -0
- telnyx/types/oauth_retrieve_response.py +47 -0
- telnyx/types/oauth_token_params.py +33 -0
- telnyx/types/oauth_token_response.py +25 -0
- telnyx/types/phone_number_delete_response.py +7 -0
- telnyx/types/phone_number_detailed.py +7 -0
- telnyx/types/phone_number_list_params.py +6 -0
- telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
- telnyx/types/porting_order.py +3 -0
- telnyx/types/porting_order_create_params.py +3 -0
- telnyx/types/porting_order_list_params.py +52 -31
- telnyx/types/porting_order_update_params.py +2 -0
- telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
- telnyx/types/shared/simple_sim_card.py +15 -0
- telnyx/types/sim_card.py +12 -0
- telnyx/types/sim_card_update_params.py +2 -1
- telnyx/types/stream_bidirectional_codec.py +1 -1
- telnyx/types/stream_codec.py +1 -1
- telnyx/types/verification_trigger_call_params.py +7 -0
- telnyx/types/verify_profile_create_template_params.py +12 -0
- telnyx/types/verify_profile_create_template_response.py +17 -0
- telnyx/types/verify_profile_update_template_params.py +12 -0
- telnyx/types/verify_profile_update_template_response.py +17 -0
- telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
- telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/METADATA +1 -1
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/RECORD +130 -48
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/WHEEL +0 -0
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.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
|
+
)
|
|
@@ -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[
|
|
378
|
-
filter[
|
|
379
|
-
filter[
|
|
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[
|
|
877
|
-
filter[
|
|
878
|
-
filter[
|
|
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],
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing import Optional
|
|
5
6
|
from typing_extensions import Literal
|
|
6
7
|
|
|
7
8
|
import httpx
|
|
@@ -124,7 +125,7 @@ class SimCardsResource(SyncAPIResource):
|
|
|
124
125
|
self,
|
|
125
126
|
id: str,
|
|
126
127
|
*,
|
|
127
|
-
authorized_imeis: SequenceNotStr[str] | Omit = omit,
|
|
128
|
+
authorized_imeis: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
128
129
|
data_limit: sim_card_update_params.DataLimit | Omit = omit,
|
|
129
130
|
sim_card_group_id: str | Omit = omit,
|
|
130
131
|
status: SimCardStatus | Omit = omit,
|
|
@@ -517,7 +518,7 @@ class AsyncSimCardsResource(AsyncAPIResource):
|
|
|
517
518
|
self,
|
|
518
519
|
id: str,
|
|
519
520
|
*,
|
|
520
|
-
authorized_imeis: SequenceNotStr[str] | Omit = omit,
|
|
521
|
+
authorized_imeis: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
521
522
|
data_limit: sim_card_update_params.DataLimit | Omit = omit,
|
|
522
523
|
sim_card_group_id: str | Omit = omit,
|
|
523
524
|
status: SimCardStatus | Omit = omit,
|
|
@@ -111,6 +111,7 @@ class VerificationsResource(SyncAPIResource):
|
|
|
111
111
|
phone_number: str,
|
|
112
112
|
verify_profile_id: str,
|
|
113
113
|
custom_code: Optional[str] | Omit = omit,
|
|
114
|
+
extension: Optional[str] | Omit = omit,
|
|
114
115
|
timeout_secs: int | Omit = omit,
|
|
115
116
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
116
117
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -129,6 +130,9 @@ class VerificationsResource(SyncAPIResource):
|
|
|
129
130
|
|
|
130
131
|
custom_code: Send a self-generated numeric code to the end-user
|
|
131
132
|
|
|
133
|
+
extension: Optional extension to dial after call is answered using DTMF digits. Valid
|
|
134
|
+
digits are 0-9, A-D, \\**, and #. Pauses can be added using w (0.5s) and W (1s).
|
|
135
|
+
|
|
132
136
|
timeout_secs: The number of seconds the verification code is valid for.
|
|
133
137
|
|
|
134
138
|
extra_headers: Send extra headers
|
|
@@ -146,6 +150,7 @@ class VerificationsResource(SyncAPIResource):
|
|
|
146
150
|
"phone_number": phone_number,
|
|
147
151
|
"verify_profile_id": verify_profile_id,
|
|
148
152
|
"custom_code": custom_code,
|
|
153
|
+
"extension": extension,
|
|
149
154
|
"timeout_secs": timeout_secs,
|
|
150
155
|
},
|
|
151
156
|
verification_trigger_call_params.VerificationTriggerCallParams,
|
|
@@ -322,6 +327,7 @@ class AsyncVerificationsResource(AsyncAPIResource):
|
|
|
322
327
|
phone_number: str,
|
|
323
328
|
verify_profile_id: str,
|
|
324
329
|
custom_code: Optional[str] | Omit = omit,
|
|
330
|
+
extension: Optional[str] | Omit = omit,
|
|
325
331
|
timeout_secs: int | Omit = omit,
|
|
326
332
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
327
333
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -340,6 +346,9 @@ class AsyncVerificationsResource(AsyncAPIResource):
|
|
|
340
346
|
|
|
341
347
|
custom_code: Send a self-generated numeric code to the end-user
|
|
342
348
|
|
|
349
|
+
extension: Optional extension to dial after call is answered using DTMF digits. Valid
|
|
350
|
+
digits are 0-9, A-D, \\**, and #. Pauses can be added using w (0.5s) and W (1s).
|
|
351
|
+
|
|
343
352
|
timeout_secs: The number of seconds the verification code is valid for.
|
|
344
353
|
|
|
345
354
|
extra_headers: Send extra headers
|
|
@@ -357,6 +366,7 @@ class AsyncVerificationsResource(AsyncAPIResource):
|
|
|
357
366
|
"phone_number": phone_number,
|
|
358
367
|
"verify_profile_id": verify_profile_id,
|
|
359
368
|
"custom_code": custom_code,
|
|
369
|
+
"extension": extension,
|
|
360
370
|
"timeout_secs": timeout_secs,
|
|
361
371
|
},
|
|
362
372
|
verification_trigger_call_params.VerificationTriggerCallParams,
|