telnyx 3.5.0__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.
- telnyx/_version.py +1 -1
- telnyx/resources/ai/assistants/assistants.py +13 -15
- telnyx/resources/ai/assistants/versions.py +13 -15
- telnyx/resources/calls/actions.py +4 -2
- telnyx/resources/calls/calls.py +4 -2
- telnyx/resources/documents.py +242 -37
- telnyx/resources/messaging_tollfree/verification/requests.py +6 -9
- telnyx/resources/verify_profiles.py +9 -10
- telnyx/types/__init__.py +8 -6
- telnyx/types/access_ip_address_list_response.py +3 -12
- telnyx/types/access_ip_range_list_response.py +3 -12
- telnyx/types/ai/__init__.py +1 -3
- telnyx/types/ai/assistants/__init__.py +0 -3
- telnyx/types/ai/assistants_list.py +4 -88
- telnyx/types/ai/{assistant_clone_response.py → inference_embedding.py} +2 -2
- telnyx/types/call_dial_params.py +2 -1
- telnyx/types/calls/__init__.py +1 -0
- telnyx/types/calls/action_start_streaming_params.py +2 -1
- telnyx/types/calls/action_start_transcription_params.py +2 -102
- telnyx/types/calls/telnyx_transcription_language.py +108 -0
- telnyx/types/calls/transcription_engine_b_config_param.py +3 -102
- telnyx/types/calls/transcription_start_request_param.py +2 -102
- telnyx/types/document_upload_json_params.py +39 -0
- telnyx/types/document_upload_json_response.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +1 -0
- telnyx/types/legacy/reporting/batch_detail_records/batch_csv_pagination_meta.py +17 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +3 -12
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +3 -12
- telnyx/types/legacy/reporting/usage_reports/__init__.py +1 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +3 -12
- telnyx/types/legacy/reporting/usage_reports/standard_pagination_meta.py +17 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +3 -12
- telnyx/types/{verify_profile_create_template_response.py → message_template.py} +2 -2
- telnyx/types/messaging_tollfree/verification/__init__.py +1 -0
- telnyx/types/messaging_tollfree/verification/request_create_params.py +3 -5
- telnyx/types/messaging_tollfree/verification/request_update_params.py +3 -5
- telnyx/types/messaging_tollfree/verification/toll_free_verification_entity_type.py +9 -0
- telnyx/types/messaging_tollfree/verification/verification_request_egress.py +2 -4
- telnyx/types/messaging_tollfree/verification/verification_request_status.py +2 -4
- telnyx/types/oauth_client_list_response.py +3 -16
- telnyx/types/oauth_grant_list_response.py +3 -16
- telnyx/types/pagination_meta_cloudflare_ip_list_sync.py +15 -0
- telnyx/types/pagination_meta_oauth.py +21 -0
- telnyx/types/phone_number_blocks/__init__.py +1 -0
- telnyx/types/phone_number_blocks/job.py +3 -34
- telnyx/types/phone_number_blocks/job_error.py +32 -0
- telnyx/types/phone_numbers/phone_numbers_job.py +3 -36
- telnyx/types/report_list_mdrs_response.py +3 -12
- telnyx/types/reports/__init__.py +1 -0
- telnyx/types/reports/mdr_usage_report_list_response.py +3 -12
- telnyx/types/reports/pagination_meta_reporting.py +17 -0
- telnyx/types/stream_bidirectional_sampling_rate.py +7 -0
- telnyx/types/verifications/__init__.py +1 -0
- telnyx/types/verifications/by_phone_number_list_response.py +4 -13
- telnyx/types/verifications/verify_meta.py +17 -0
- telnyx/types/verify_profile_list_response.py +4 -13
- {telnyx-3.5.0.dist-info → telnyx-3.6.0.dist-info}/METADATA +2 -2
- {telnyx-3.5.0.dist-info → telnyx-3.6.0.dist-info}/RECORD +60 -54
- telnyx/types/ai/assistant_create_response.py +0 -92
- telnyx/types/ai/assistant_retrieve_response.py +0 -92
- telnyx/types/ai/assistants/version_promote_response.py +0 -92
- telnyx/types/ai/assistants/version_retrieve_response.py +0 -92
- telnyx/types/ai/assistants/version_update_response.py +0 -92
- telnyx/types/verify_profile_update_template_response.py +0 -12
- {telnyx-3.5.0.dist-info → telnyx-3.6.0.dist-info}/WHEEL +0 -0
- {telnyx-3.5.0.dist-info → telnyx-3.6.0.dist-info}/licenses/LICENSE +0 -0
telnyx/_version.py
CHANGED
|
@@ -67,17 +67,15 @@ from .scheduled_events import (
|
|
|
67
67
|
)
|
|
68
68
|
from ....types.ai.assistants_list import AssistantsList
|
|
69
69
|
from ....types.ai.enabled_features import EnabledFeatures
|
|
70
|
+
from ....types.ai.inference_embedding import InferenceEmbedding
|
|
70
71
|
from ....types.ai.assistant_tool_param import AssistantToolParam
|
|
71
72
|
from ....types.ai.voice_settings_param import VoiceSettingsParam
|
|
72
73
|
from ....types.ai.insight_settings_param import InsightSettingsParam
|
|
73
74
|
from ....types.ai.privacy_settings_param import PrivacySettingsParam
|
|
74
75
|
from ....types.ai.assistant_chat_response import AssistantChatResponse
|
|
75
|
-
from ....types.ai.assistant_clone_response import AssistantCloneResponse
|
|
76
76
|
from ....types.ai.messaging_settings_param import MessagingSettingsParam
|
|
77
77
|
from ....types.ai.telephony_settings_param import TelephonySettingsParam
|
|
78
|
-
from ....types.ai.assistant_create_response import AssistantCreateResponse
|
|
79
78
|
from ....types.ai.assistant_delete_response import AssistantDeleteResponse
|
|
80
|
-
from ....types.ai.assistant_retrieve_response import AssistantRetrieveResponse
|
|
81
79
|
from ....types.ai.transcription_settings_param import TranscriptionSettingsParam
|
|
82
80
|
|
|
83
81
|
__all__ = ["AssistantsResource", "AsyncAssistantsResource"]
|
|
@@ -148,7 +146,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
148
146
|
extra_query: Query | None = None,
|
|
149
147
|
extra_body: Body | None = None,
|
|
150
148
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
151
|
-
) ->
|
|
149
|
+
) -> InferenceEmbedding:
|
|
152
150
|
"""
|
|
153
151
|
Create a new AI Assistant.
|
|
154
152
|
|
|
@@ -214,7 +212,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
214
212
|
options=make_request_options(
|
|
215
213
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
216
214
|
),
|
|
217
|
-
cast_to=
|
|
215
|
+
cast_to=InferenceEmbedding,
|
|
218
216
|
)
|
|
219
217
|
|
|
220
218
|
def retrieve(
|
|
@@ -231,7 +229,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
231
229
|
extra_query: Query | None = None,
|
|
232
230
|
extra_body: Body | None = None,
|
|
233
231
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
234
|
-
) ->
|
|
232
|
+
) -> InferenceEmbedding:
|
|
235
233
|
"""
|
|
236
234
|
Retrieve an AI Assistant configuration by `assistant_id`.
|
|
237
235
|
|
|
@@ -263,7 +261,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
263
261
|
assistant_retrieve_params.AssistantRetrieveParams,
|
|
264
262
|
),
|
|
265
263
|
),
|
|
266
|
-
cast_to=
|
|
264
|
+
cast_to=InferenceEmbedding,
|
|
267
265
|
)
|
|
268
266
|
|
|
269
267
|
def update(
|
|
@@ -487,7 +485,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
487
485
|
extra_query: Query | None = None,
|
|
488
486
|
extra_body: Body | None = None,
|
|
489
487
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
490
|
-
) ->
|
|
488
|
+
) -> InferenceEmbedding:
|
|
491
489
|
"""
|
|
492
490
|
Clone an existing assistant, excluding telephony and messaging settings.
|
|
493
491
|
|
|
@@ -507,7 +505,7 @@ class AssistantsResource(SyncAPIResource):
|
|
|
507
505
|
options=make_request_options(
|
|
508
506
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
509
507
|
),
|
|
510
|
-
cast_to=
|
|
508
|
+
cast_to=InferenceEmbedding,
|
|
511
509
|
)
|
|
512
510
|
|
|
513
511
|
def get_texml(
|
|
@@ -657,7 +655,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
657
655
|
extra_query: Query | None = None,
|
|
658
656
|
extra_body: Body | None = None,
|
|
659
657
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
660
|
-
) ->
|
|
658
|
+
) -> InferenceEmbedding:
|
|
661
659
|
"""
|
|
662
660
|
Create a new AI Assistant.
|
|
663
661
|
|
|
@@ -723,7 +721,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
723
721
|
options=make_request_options(
|
|
724
722
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
725
723
|
),
|
|
726
|
-
cast_to=
|
|
724
|
+
cast_to=InferenceEmbedding,
|
|
727
725
|
)
|
|
728
726
|
|
|
729
727
|
async def retrieve(
|
|
@@ -740,7 +738,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
740
738
|
extra_query: Query | None = None,
|
|
741
739
|
extra_body: Body | None = None,
|
|
742
740
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
743
|
-
) ->
|
|
741
|
+
) -> InferenceEmbedding:
|
|
744
742
|
"""
|
|
745
743
|
Retrieve an AI Assistant configuration by `assistant_id`.
|
|
746
744
|
|
|
@@ -772,7 +770,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
772
770
|
assistant_retrieve_params.AssistantRetrieveParams,
|
|
773
771
|
),
|
|
774
772
|
),
|
|
775
|
-
cast_to=
|
|
773
|
+
cast_to=InferenceEmbedding,
|
|
776
774
|
)
|
|
777
775
|
|
|
778
776
|
async def update(
|
|
@@ -996,7 +994,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
996
994
|
extra_query: Query | None = None,
|
|
997
995
|
extra_body: Body | None = None,
|
|
998
996
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
999
|
-
) ->
|
|
997
|
+
) -> InferenceEmbedding:
|
|
1000
998
|
"""
|
|
1001
999
|
Clone an existing assistant, excluding telephony and messaging settings.
|
|
1002
1000
|
|
|
@@ -1016,7 +1014,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
|
|
|
1016
1014
|
options=make_request_options(
|
|
1017
1015
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1018
1016
|
),
|
|
1019
|
-
cast_to=
|
|
1017
|
+
cast_to=InferenceEmbedding,
|
|
1020
1018
|
)
|
|
1021
1019
|
|
|
1022
1020
|
async def get_texml(
|
|
@@ -20,6 +20,7 @@ from ...._base_client import make_request_options
|
|
|
20
20
|
from ....types.ai.assistants import version_update_params, version_retrieve_params
|
|
21
21
|
from ....types.ai.assistants_list import AssistantsList
|
|
22
22
|
from ....types.ai.enabled_features import EnabledFeatures
|
|
23
|
+
from ....types.ai.inference_embedding import InferenceEmbedding
|
|
23
24
|
from ....types.ai.assistant_tool_param import AssistantToolParam
|
|
24
25
|
from ....types.ai.voice_settings_param import VoiceSettingsParam
|
|
25
26
|
from ....types.ai.insight_settings_param import InsightSettingsParam
|
|
@@ -27,9 +28,6 @@ from ....types.ai.privacy_settings_param import PrivacySettingsParam
|
|
|
27
28
|
from ....types.ai.messaging_settings_param import MessagingSettingsParam
|
|
28
29
|
from ....types.ai.telephony_settings_param import TelephonySettingsParam
|
|
29
30
|
from ....types.ai.transcription_settings_param import TranscriptionSettingsParam
|
|
30
|
-
from ....types.ai.assistants.version_update_response import VersionUpdateResponse
|
|
31
|
-
from ....types.ai.assistants.version_promote_response import VersionPromoteResponse
|
|
32
|
-
from ....types.ai.assistants.version_retrieve_response import VersionRetrieveResponse
|
|
33
31
|
|
|
34
32
|
__all__ = ["VersionsResource", "AsyncVersionsResource"]
|
|
35
33
|
|
|
@@ -66,7 +64,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
66
64
|
extra_query: Query | None = None,
|
|
67
65
|
extra_body: Body | None = None,
|
|
68
66
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
69
|
-
) ->
|
|
67
|
+
) -> InferenceEmbedding:
|
|
70
68
|
"""
|
|
71
69
|
Retrieves a specific version of an assistant by assistant_id and version_id
|
|
72
70
|
|
|
@@ -94,7 +92,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
94
92
|
{"include_mcp_servers": include_mcp_servers}, version_retrieve_params.VersionRetrieveParams
|
|
95
93
|
),
|
|
96
94
|
),
|
|
97
|
-
cast_to=
|
|
95
|
+
cast_to=InferenceEmbedding,
|
|
98
96
|
)
|
|
99
97
|
|
|
100
98
|
def update(
|
|
@@ -124,7 +122,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
124
122
|
extra_query: Query | None = None,
|
|
125
123
|
extra_body: Body | None = None,
|
|
126
124
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
127
|
-
) ->
|
|
125
|
+
) -> InferenceEmbedding:
|
|
128
126
|
"""Updates the configuration of a specific assistant version.
|
|
129
127
|
|
|
130
128
|
Can not update main
|
|
@@ -196,7 +194,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
196
194
|
options=make_request_options(
|
|
197
195
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
198
196
|
),
|
|
199
|
-
cast_to=
|
|
197
|
+
cast_to=InferenceEmbedding,
|
|
200
198
|
)
|
|
201
199
|
|
|
202
200
|
def list(
|
|
@@ -283,7 +281,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
283
281
|
extra_query: Query | None = None,
|
|
284
282
|
extra_body: Body | None = None,
|
|
285
283
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
286
|
-
) ->
|
|
284
|
+
) -> InferenceEmbedding:
|
|
287
285
|
"""
|
|
288
286
|
Promotes a specific version to be the main/current version of the assistant.
|
|
289
287
|
This will delete any existing canary deploy configuration and send all live
|
|
@@ -307,7 +305,7 @@ class VersionsResource(SyncAPIResource):
|
|
|
307
305
|
options=make_request_options(
|
|
308
306
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
309
307
|
),
|
|
310
|
-
cast_to=
|
|
308
|
+
cast_to=InferenceEmbedding,
|
|
311
309
|
)
|
|
312
310
|
|
|
313
311
|
|
|
@@ -343,7 +341,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
343
341
|
extra_query: Query | None = None,
|
|
344
342
|
extra_body: Body | None = None,
|
|
345
343
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
346
|
-
) ->
|
|
344
|
+
) -> InferenceEmbedding:
|
|
347
345
|
"""
|
|
348
346
|
Retrieves a specific version of an assistant by assistant_id and version_id
|
|
349
347
|
|
|
@@ -371,7 +369,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
371
369
|
{"include_mcp_servers": include_mcp_servers}, version_retrieve_params.VersionRetrieveParams
|
|
372
370
|
),
|
|
373
371
|
),
|
|
374
|
-
cast_to=
|
|
372
|
+
cast_to=InferenceEmbedding,
|
|
375
373
|
)
|
|
376
374
|
|
|
377
375
|
async def update(
|
|
@@ -401,7 +399,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
401
399
|
extra_query: Query | None = None,
|
|
402
400
|
extra_body: Body | None = None,
|
|
403
401
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
404
|
-
) ->
|
|
402
|
+
) -> InferenceEmbedding:
|
|
405
403
|
"""Updates the configuration of a specific assistant version.
|
|
406
404
|
|
|
407
405
|
Can not update main
|
|
@@ -473,7 +471,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
473
471
|
options=make_request_options(
|
|
474
472
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
475
473
|
),
|
|
476
|
-
cast_to=
|
|
474
|
+
cast_to=InferenceEmbedding,
|
|
477
475
|
)
|
|
478
476
|
|
|
479
477
|
async def list(
|
|
@@ -560,7 +558,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
560
558
|
extra_query: Query | None = None,
|
|
561
559
|
extra_body: Body | None = None,
|
|
562
560
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
563
|
-
) ->
|
|
561
|
+
) -> InferenceEmbedding:
|
|
564
562
|
"""
|
|
565
563
|
Promotes a specific version to be the main/current version of the assistant.
|
|
566
564
|
This will delete any existing canary deploy configuration and send all live
|
|
@@ -584,7 +582,7 @@ class AsyncVersionsResource(AsyncAPIResource):
|
|
|
584
582
|
options=make_request_options(
|
|
585
583
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
586
584
|
),
|
|
587
|
-
cast_to=
|
|
585
|
+
cast_to=InferenceEmbedding,
|
|
588
586
|
)
|
|
589
587
|
|
|
590
588
|
|
|
@@ -12,6 +12,7 @@ from ...types import (
|
|
|
12
12
|
StreamBidirectionalMode,
|
|
13
13
|
StreamBidirectionalCodec,
|
|
14
14
|
StreamBidirectionalTargetLegs,
|
|
15
|
+
StreamBidirectionalSamplingRate,
|
|
15
16
|
)
|
|
16
17
|
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
17
18
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
@@ -90,6 +91,7 @@ from ...types.calls.action_stop_siprec_response import ActionStopSiprecResponse
|
|
|
90
91
|
from ...types.calls.interruption_settings_param import InterruptionSettingsParam
|
|
91
92
|
from ...types.calls.action_start_siprec_response import ActionStartSiprecResponse
|
|
92
93
|
from ...types.calls.action_stop_forking_response import ActionStopForkingResponse
|
|
94
|
+
from ...types.stream_bidirectional_sampling_rate import StreamBidirectionalSamplingRate
|
|
93
95
|
from ...types.calls.action_send_sip_info_response import ActionSendSipInfoResponse
|
|
94
96
|
from ...types.calls.action_start_forking_response import ActionStartForkingResponse
|
|
95
97
|
from ...types.calls.action_stop_playback_response import ActionStopPlaybackResponse
|
|
@@ -2421,7 +2423,7 @@ class ActionsResource(SyncAPIResource):
|
|
|
2421
2423
|
enable_dialogflow: bool | Omit = omit,
|
|
2422
2424
|
stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
|
|
2423
2425
|
stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
|
|
2424
|
-
stream_bidirectional_sampling_rate:
|
|
2426
|
+
stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
|
|
2425
2427
|
stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
|
|
2426
2428
|
stream_codec: StreamCodec | Omit = omit,
|
|
2427
2429
|
stream_track: Literal["inbound_track", "outbound_track", "both_tracks"] | Omit = omit,
|
|
@@ -5664,7 +5666,7 @@ class AsyncActionsResource(AsyncAPIResource):
|
|
|
5664
5666
|
enable_dialogflow: bool | Omit = omit,
|
|
5665
5667
|
stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
|
|
5666
5668
|
stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
|
|
5667
|
-
stream_bidirectional_sampling_rate:
|
|
5669
|
+
stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
|
|
5668
5670
|
stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
|
|
5669
5671
|
stream_codec: StreamCodec | Omit = omit,
|
|
5670
5672
|
stream_track: Literal["inbound_track", "outbound_track", "both_tracks"] | Omit = omit,
|
telnyx/resources/calls/calls.py
CHANGED
|
@@ -12,6 +12,7 @@ from ...types import (
|
|
|
12
12
|
StreamBidirectionalMode,
|
|
13
13
|
StreamBidirectionalCodec,
|
|
14
14
|
StreamBidirectionalTargetLegs,
|
|
15
|
+
StreamBidirectionalSamplingRate,
|
|
15
16
|
call_dial_params,
|
|
16
17
|
)
|
|
17
18
|
from .actions import (
|
|
@@ -43,6 +44,7 @@ from ...types.stream_bidirectional_mode import StreamBidirectionalMode
|
|
|
43
44
|
from ...types.stream_bidirectional_codec import StreamBidirectionalCodec
|
|
44
45
|
from ...types.call_retrieve_status_response import CallRetrieveStatusResponse
|
|
45
46
|
from ...types.stream_bidirectional_target_legs import StreamBidirectionalTargetLegs
|
|
47
|
+
from ...types.stream_bidirectional_sampling_rate import StreamBidirectionalSamplingRate
|
|
46
48
|
from ...types.calls.transcription_start_request_param import TranscriptionStartRequestParam
|
|
47
49
|
|
|
48
50
|
__all__ = ["CallsResource", "AsyncCallsResource"]
|
|
@@ -115,7 +117,7 @@ class CallsResource(SyncAPIResource):
|
|
|
115
117
|
sound_modifications: SoundModificationsParam | Omit = omit,
|
|
116
118
|
stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
|
|
117
119
|
stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
|
|
118
|
-
stream_bidirectional_sampling_rate:
|
|
120
|
+
stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
|
|
119
121
|
stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
|
|
120
122
|
stream_codec: StreamCodec | Omit = omit,
|
|
121
123
|
stream_establish_before_call_originate: bool | Omit = omit,
|
|
@@ -498,7 +500,7 @@ class AsyncCallsResource(AsyncAPIResource):
|
|
|
498
500
|
sound_modifications: SoundModificationsParam | Omit = omit,
|
|
499
501
|
stream_bidirectional_codec: StreamBidirectionalCodec | Omit = omit,
|
|
500
502
|
stream_bidirectional_mode: StreamBidirectionalMode | Omit = omit,
|
|
501
|
-
stream_bidirectional_sampling_rate:
|
|
503
|
+
stream_bidirectional_sampling_rate: StreamBidirectionalSamplingRate | Omit = omit,
|
|
502
504
|
stream_bidirectional_target_legs: StreamBidirectionalTargetLegs | Omit = omit,
|
|
503
505
|
stream_codec: StreamCodec | Omit = omit,
|
|
504
506
|
stream_establish_before_call_originate: bool | Omit = omit,
|
telnyx/resources/documents.py
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List, Union
|
|
5
|
+
from typing import List, Union
|
|
6
6
|
from typing_extensions import Literal, overload
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import document_list_params, document_update_params, document_upload_params
|
|
10
|
+
from ..types import document_list_params, document_update_params, document_upload_params, document_upload_json_params
|
|
11
11
|
from .._types import Body, Omit, Query, Headers, NotGiven, Base64FileInput, omit, not_given
|
|
12
|
-
from .._utils import
|
|
12
|
+
from .._utils import required_args, maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
15
|
from .._response import (
|
|
@@ -32,6 +32,7 @@ from ..types.document_delete_response import DocumentDeleteResponse
|
|
|
32
32
|
from ..types.document_update_response import DocumentUpdateResponse
|
|
33
33
|
from ..types.document_upload_response import DocumentUploadResponse
|
|
34
34
|
from ..types.document_retrieve_response import DocumentRetrieveResponse
|
|
35
|
+
from ..types.document_upload_json_response import DocumentUploadJsonResponse
|
|
35
36
|
from ..types.document_generate_download_link_response import DocumentGenerateDownloadLinkResponse
|
|
36
37
|
|
|
37
38
|
__all__ = ["DocumentsResource", "AsyncDocumentsResource"]
|
|
@@ -380,30 +381,126 @@ class DocumentsResource(SyncAPIResource):
|
|
|
380
381
|
extra_body: Body | None = None,
|
|
381
382
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
382
383
|
) -> DocumentUploadResponse:
|
|
383
|
-
body = deepcopy_minimal(
|
|
384
|
-
{
|
|
385
|
-
"url": url,
|
|
386
|
-
"customer_reference": customer_reference,
|
|
387
|
-
"filename": filename,
|
|
388
|
-
"file": file,
|
|
389
|
-
}
|
|
390
|
-
)
|
|
391
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
392
|
-
if files:
|
|
393
|
-
# It should be noted that the actual Content-Type header that will be
|
|
394
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
|
395
|
-
# multipart/form-data; boundary=---abc--
|
|
396
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
397
384
|
return self._post(
|
|
398
|
-
"/documents",
|
|
399
|
-
body=maybe_transform(
|
|
400
|
-
|
|
385
|
+
"/documents?content-type=multipart",
|
|
386
|
+
body=maybe_transform(
|
|
387
|
+
{
|
|
388
|
+
"url": url,
|
|
389
|
+
"customer_reference": customer_reference,
|
|
390
|
+
"filename": filename,
|
|
391
|
+
"file": file,
|
|
392
|
+
},
|
|
393
|
+
document_upload_params.DocumentUploadParams,
|
|
394
|
+
),
|
|
401
395
|
options=make_request_options(
|
|
402
396
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
403
397
|
),
|
|
404
398
|
cast_to=DocumentUploadResponse,
|
|
405
399
|
)
|
|
406
400
|
|
|
401
|
+
@overload
|
|
402
|
+
def upload_json(
|
|
403
|
+
self,
|
|
404
|
+
*,
|
|
405
|
+
url: str,
|
|
406
|
+
customer_reference: str | Omit = omit,
|
|
407
|
+
filename: str | Omit = omit,
|
|
408
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
409
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
410
|
+
extra_headers: Headers | None = None,
|
|
411
|
+
extra_query: Query | None = None,
|
|
412
|
+
extra_body: Body | None = None,
|
|
413
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
414
|
+
) -> DocumentUploadJsonResponse:
|
|
415
|
+
"""
|
|
416
|
+
Upload a document.<br /><br />Uploaded files must be linked to a service within
|
|
417
|
+
30 minutes or they will be automatically deleted.
|
|
418
|
+
|
|
419
|
+
Args:
|
|
420
|
+
url: If the file is already hosted publicly, you can provide a URL and have the
|
|
421
|
+
documents service fetch it for you.
|
|
422
|
+
|
|
423
|
+
customer_reference: Optional reference string for customer tracking.
|
|
424
|
+
|
|
425
|
+
filename: The filename of the document.
|
|
426
|
+
|
|
427
|
+
extra_headers: Send extra headers
|
|
428
|
+
|
|
429
|
+
extra_query: Add additional query parameters to the request
|
|
430
|
+
|
|
431
|
+
extra_body: Add additional JSON properties to the request
|
|
432
|
+
|
|
433
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
434
|
+
"""
|
|
435
|
+
...
|
|
436
|
+
|
|
437
|
+
@overload
|
|
438
|
+
def upload_json(
|
|
439
|
+
self,
|
|
440
|
+
*,
|
|
441
|
+
file: Union[str, Base64FileInput],
|
|
442
|
+
customer_reference: str | Omit = omit,
|
|
443
|
+
filename: str | Omit = omit,
|
|
444
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
445
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
446
|
+
extra_headers: Headers | None = None,
|
|
447
|
+
extra_query: Query | None = None,
|
|
448
|
+
extra_body: Body | None = None,
|
|
449
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
450
|
+
) -> DocumentUploadJsonResponse:
|
|
451
|
+
"""
|
|
452
|
+
Upload a document.<br /><br />Uploaded files must be linked to a service within
|
|
453
|
+
30 minutes or they will be automatically deleted.
|
|
454
|
+
|
|
455
|
+
Args:
|
|
456
|
+
file: The Base64 encoded contents of the file you are uploading.
|
|
457
|
+
|
|
458
|
+
customer_reference: A customer reference string for customer look ups.
|
|
459
|
+
|
|
460
|
+
filename: The filename of the document.
|
|
461
|
+
|
|
462
|
+
extra_headers: Send extra headers
|
|
463
|
+
|
|
464
|
+
extra_query: Add additional query parameters to the request
|
|
465
|
+
|
|
466
|
+
extra_body: Add additional JSON properties to the request
|
|
467
|
+
|
|
468
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
469
|
+
"""
|
|
470
|
+
...
|
|
471
|
+
|
|
472
|
+
@required_args(["url"], ["file"])
|
|
473
|
+
def upload_json(
|
|
474
|
+
self,
|
|
475
|
+
*,
|
|
476
|
+
url: str | Omit = omit,
|
|
477
|
+
customer_reference: str | Omit = omit,
|
|
478
|
+
filename: str | Omit = omit,
|
|
479
|
+
file: Union[str, Base64FileInput] | Omit = omit,
|
|
480
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
481
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
482
|
+
extra_headers: Headers | None = None,
|
|
483
|
+
extra_query: Query | None = None,
|
|
484
|
+
extra_body: Body | None = None,
|
|
485
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
486
|
+
) -> DocumentUploadJsonResponse:
|
|
487
|
+
return self._post(
|
|
488
|
+
"/documents",
|
|
489
|
+
body=maybe_transform(
|
|
490
|
+
{
|
|
491
|
+
"url": url,
|
|
492
|
+
"customer_reference": customer_reference,
|
|
493
|
+
"filename": filename,
|
|
494
|
+
"file": file,
|
|
495
|
+
},
|
|
496
|
+
document_upload_json_params.DocumentUploadJsonParams,
|
|
497
|
+
),
|
|
498
|
+
options=make_request_options(
|
|
499
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
500
|
+
),
|
|
501
|
+
cast_to=DocumentUploadJsonResponse,
|
|
502
|
+
)
|
|
503
|
+
|
|
407
504
|
|
|
408
505
|
class AsyncDocumentsResource(AsyncAPIResource):
|
|
409
506
|
@cached_property
|
|
@@ -748,30 +845,126 @@ class AsyncDocumentsResource(AsyncAPIResource):
|
|
|
748
845
|
extra_body: Body | None = None,
|
|
749
846
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
750
847
|
) -> DocumentUploadResponse:
|
|
751
|
-
body = deepcopy_minimal(
|
|
752
|
-
{
|
|
753
|
-
"url": url,
|
|
754
|
-
"customer_reference": customer_reference,
|
|
755
|
-
"filename": filename,
|
|
756
|
-
"file": file,
|
|
757
|
-
}
|
|
758
|
-
)
|
|
759
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
760
|
-
if files:
|
|
761
|
-
# It should be noted that the actual Content-Type header that will be
|
|
762
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
|
763
|
-
# multipart/form-data; boundary=---abc--
|
|
764
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
765
848
|
return await self._post(
|
|
766
|
-
"/documents",
|
|
767
|
-
body=await async_maybe_transform(
|
|
768
|
-
|
|
849
|
+
"/documents?content-type=multipart",
|
|
850
|
+
body=await async_maybe_transform(
|
|
851
|
+
{
|
|
852
|
+
"url": url,
|
|
853
|
+
"customer_reference": customer_reference,
|
|
854
|
+
"filename": filename,
|
|
855
|
+
"file": file,
|
|
856
|
+
},
|
|
857
|
+
document_upload_params.DocumentUploadParams,
|
|
858
|
+
),
|
|
769
859
|
options=make_request_options(
|
|
770
860
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
771
861
|
),
|
|
772
862
|
cast_to=DocumentUploadResponse,
|
|
773
863
|
)
|
|
774
864
|
|
|
865
|
+
@overload
|
|
866
|
+
async def upload_json(
|
|
867
|
+
self,
|
|
868
|
+
*,
|
|
869
|
+
url: str,
|
|
870
|
+
customer_reference: str | Omit = omit,
|
|
871
|
+
filename: str | Omit = omit,
|
|
872
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
873
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
874
|
+
extra_headers: Headers | None = None,
|
|
875
|
+
extra_query: Query | None = None,
|
|
876
|
+
extra_body: Body | None = None,
|
|
877
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
878
|
+
) -> DocumentUploadJsonResponse:
|
|
879
|
+
"""
|
|
880
|
+
Upload a document.<br /><br />Uploaded files must be linked to a service within
|
|
881
|
+
30 minutes or they will be automatically deleted.
|
|
882
|
+
|
|
883
|
+
Args:
|
|
884
|
+
url: If the file is already hosted publicly, you can provide a URL and have the
|
|
885
|
+
documents service fetch it for you.
|
|
886
|
+
|
|
887
|
+
customer_reference: Optional reference string for customer tracking.
|
|
888
|
+
|
|
889
|
+
filename: The filename of the document.
|
|
890
|
+
|
|
891
|
+
extra_headers: Send extra headers
|
|
892
|
+
|
|
893
|
+
extra_query: Add additional query parameters to the request
|
|
894
|
+
|
|
895
|
+
extra_body: Add additional JSON properties to the request
|
|
896
|
+
|
|
897
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
898
|
+
"""
|
|
899
|
+
...
|
|
900
|
+
|
|
901
|
+
@overload
|
|
902
|
+
async def upload_json(
|
|
903
|
+
self,
|
|
904
|
+
*,
|
|
905
|
+
file: Union[str, Base64FileInput],
|
|
906
|
+
customer_reference: str | Omit = omit,
|
|
907
|
+
filename: str | Omit = omit,
|
|
908
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
909
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
910
|
+
extra_headers: Headers | None = None,
|
|
911
|
+
extra_query: Query | None = None,
|
|
912
|
+
extra_body: Body | None = None,
|
|
913
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
914
|
+
) -> DocumentUploadJsonResponse:
|
|
915
|
+
"""
|
|
916
|
+
Upload a document.<br /><br />Uploaded files must be linked to a service within
|
|
917
|
+
30 minutes or they will be automatically deleted.
|
|
918
|
+
|
|
919
|
+
Args:
|
|
920
|
+
file: The Base64 encoded contents of the file you are uploading.
|
|
921
|
+
|
|
922
|
+
customer_reference: A customer reference string for customer look ups.
|
|
923
|
+
|
|
924
|
+
filename: The filename of the document.
|
|
925
|
+
|
|
926
|
+
extra_headers: Send extra headers
|
|
927
|
+
|
|
928
|
+
extra_query: Add additional query parameters to the request
|
|
929
|
+
|
|
930
|
+
extra_body: Add additional JSON properties to the request
|
|
931
|
+
|
|
932
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
933
|
+
"""
|
|
934
|
+
...
|
|
935
|
+
|
|
936
|
+
@required_args(["url"], ["file"])
|
|
937
|
+
async def upload_json(
|
|
938
|
+
self,
|
|
939
|
+
*,
|
|
940
|
+
url: str | Omit = omit,
|
|
941
|
+
customer_reference: str | Omit = omit,
|
|
942
|
+
filename: str | Omit = omit,
|
|
943
|
+
file: Union[str, Base64FileInput] | Omit = omit,
|
|
944
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
945
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
946
|
+
extra_headers: Headers | None = None,
|
|
947
|
+
extra_query: Query | None = None,
|
|
948
|
+
extra_body: Body | None = None,
|
|
949
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
950
|
+
) -> DocumentUploadJsonResponse:
|
|
951
|
+
return await self._post(
|
|
952
|
+
"/documents",
|
|
953
|
+
body=await async_maybe_transform(
|
|
954
|
+
{
|
|
955
|
+
"url": url,
|
|
956
|
+
"customer_reference": customer_reference,
|
|
957
|
+
"filename": filename,
|
|
958
|
+
"file": file,
|
|
959
|
+
},
|
|
960
|
+
document_upload_json_params.DocumentUploadJsonParams,
|
|
961
|
+
),
|
|
962
|
+
options=make_request_options(
|
|
963
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
964
|
+
),
|
|
965
|
+
cast_to=DocumentUploadJsonResponse,
|
|
966
|
+
)
|
|
967
|
+
|
|
775
968
|
|
|
776
969
|
class DocumentsResourceWithRawResponse:
|
|
777
970
|
def __init__(self, documents: DocumentsResource) -> None:
|
|
@@ -799,6 +992,9 @@ class DocumentsResourceWithRawResponse:
|
|
|
799
992
|
self.upload = to_raw_response_wrapper(
|
|
800
993
|
documents.upload,
|
|
801
994
|
)
|
|
995
|
+
self.upload_json = to_raw_response_wrapper(
|
|
996
|
+
documents.upload_json,
|
|
997
|
+
)
|
|
802
998
|
|
|
803
999
|
|
|
804
1000
|
class AsyncDocumentsResourceWithRawResponse:
|
|
@@ -827,6 +1023,9 @@ class AsyncDocumentsResourceWithRawResponse:
|
|
|
827
1023
|
self.upload = async_to_raw_response_wrapper(
|
|
828
1024
|
documents.upload,
|
|
829
1025
|
)
|
|
1026
|
+
self.upload_json = async_to_raw_response_wrapper(
|
|
1027
|
+
documents.upload_json,
|
|
1028
|
+
)
|
|
830
1029
|
|
|
831
1030
|
|
|
832
1031
|
class DocumentsResourceWithStreamingResponse:
|
|
@@ -855,6 +1054,9 @@ class DocumentsResourceWithStreamingResponse:
|
|
|
855
1054
|
self.upload = to_streamed_response_wrapper(
|
|
856
1055
|
documents.upload,
|
|
857
1056
|
)
|
|
1057
|
+
self.upload_json = to_streamed_response_wrapper(
|
|
1058
|
+
documents.upload_json,
|
|
1059
|
+
)
|
|
858
1060
|
|
|
859
1061
|
|
|
860
1062
|
class AsyncDocumentsResourceWithStreamingResponse:
|
|
@@ -883,3 +1085,6 @@ class AsyncDocumentsResourceWithStreamingResponse:
|
|
|
883
1085
|
self.upload = async_to_streamed_response_wrapper(
|
|
884
1086
|
documents.upload,
|
|
885
1087
|
)
|
|
1088
|
+
self.upload_json = async_to_streamed_response_wrapper(
|
|
1089
|
+
documents.upload_json,
|
|
1090
|
+
)
|