telnyx 3.7.0a0__py3-none-any.whl → 3.9.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/__init__.py +2 -0
- telnyx/_client.py +25 -756
- telnyx/_exceptions.py +4 -0
- telnyx/_version.py +1 -1
- telnyx/resources/__init__.py +3 -1
- telnyx/resources/advanced_orders.py +63 -63
- telnyx/resources/ai/assistants/assistants.py +15 -17
- telnyx/resources/ai/assistants/versions.py +13 -15
- telnyx/resources/brand/brand.py +8 -4
- telnyx/resources/calls/actions.py +10 -6
- telnyx/resources/calls/calls.py +16 -2
- telnyx/resources/documents.py +242 -37
- telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +3 -2
- telnyx/resources/legacy/reporting/batch_detail_records/voice.py +3 -2
- telnyx/resources/messaging_profiles/messaging_profiles.py +16 -0
- telnyx/resources/messaging_tollfree/verification/requests.py +203 -1
- telnyx/resources/outbound_voice_profiles.py +24 -4
- telnyx/resources/sim_cards/actions.py +12 -12
- telnyx/resources/texml/accounts/calls/calls.py +11 -0
- telnyx/resources/texml/accounts/conferences/participants.py +11 -0
- telnyx/resources/verified_numbers/verified_numbers.py +25 -4
- telnyx/resources/verify_profiles.py +9 -10
- telnyx/resources/webhooks.py +152 -4
- telnyx/types/__init__.py +18 -15
- telnyx/types/access_ip_address_list_response.py +3 -12
- telnyx/types/access_ip_range_list_response.py +3 -12
- telnyx/types/addresses/action_validate_response.py +7 -2
- telnyx/types/{advanced_order_update_params.py → advanced_order_update_requirement_group_params.py} +2 -2
- telnyx/types/ai/__init__.py +1 -3
- telnyx/types/ai/assistant_import_params.py +1 -1
- telnyx/types/ai/assistants/__init__.py +0 -3
- telnyx/types/ai/assistants_list.py +4 -88
- telnyx/types/ai/import_metadata.py +1 -1
- telnyx/types/ai/{assistant_clone_response.py → inference_embedding.py} +2 -2
- telnyx/types/ai/inference_embedding_transfer_tool_params.py +6 -0
- telnyx/types/ai/inference_embedding_transfer_tool_params_param.py +6 -0
- telnyx/types/ai/voice_settings.py +49 -2
- telnyx/types/ai/voice_settings_param.py +49 -2
- telnyx/types/brand_create_params.py +2 -1
- telnyx/types/brand_update_params.py +2 -1
- telnyx/types/call_ai_gather_ended_webhook_event1.py +78 -0
- telnyx/types/call_ai_gather_message_history_updated_webhook_event1.py +69 -0
- telnyx/types/call_ai_gather_partial_results_webhook_event1.py +75 -0
- telnyx/types/call_answered_webhook_event1.py +75 -0
- telnyx/types/call_bridged_webhook_event1.py +58 -0
- telnyx/types/call_conversation_ended_webhook_event1.py +84 -0
- telnyx/types/call_conversation_insights_generated_webhook_event1.py +67 -0
- telnyx/types/call_dial_params.py +10 -1
- telnyx/types/call_dtmf_received_webhook_event1.py +61 -0
- telnyx/types/call_enqueued_webhook_event1.py +59 -0
- telnyx/types/call_fork_started_webhook_event1.py +53 -0
- telnyx/types/call_fork_stopped_webhook_event1.py +53 -0
- telnyx/types/call_gather_ended_webhook_event1.py +64 -0
- telnyx/types/call_hangup_webhook_event1.py +150 -0
- telnyx/types/call_initiated_webhook_event1.py +96 -0
- telnyx/types/call_left_queue_webhook_event1.py +62 -0
- telnyx/types/call_machine_detection_ended_webhook_event1.py +61 -0
- telnyx/types/call_machine_greeting_ended_webhook_event1.py +61 -0
- telnyx/types/call_machine_premium_detection_ended_webhook_event1.py +63 -0
- telnyx/types/call_machine_premium_greeting_ended_webhook_event1.py +61 -0
- telnyx/types/call_playback_ended_webhook_event1.py +70 -0
- telnyx/types/call_playback_started_webhook_event1.py +62 -0
- telnyx/types/call_recording_error_webhook_event1.py +60 -0
- telnyx/types/call_recording_saved_webhook_event1.py +94 -0
- telnyx/types/call_recording_transcription_saved_webhook_event1.py +71 -0
- telnyx/types/call_refer_completed_webhook_event1.py +61 -0
- telnyx/types/call_refer_failed_webhook_event1.py +61 -0
- telnyx/types/call_refer_started_webhook_event1.py +61 -0
- telnyx/types/call_siprec_failed_webhook_event1.py +53 -0
- telnyx/types/call_siprec_started_webhook_event1.py +50 -0
- telnyx/types/call_siprec_stopped_webhook_event1.py +53 -0
- telnyx/types/call_speak_ended_webhook_event1.py +53 -0
- telnyx/types/call_speak_started_webhook_event1.py +50 -0
- telnyx/types/call_streaming_failed_webhook_event1.py +70 -0
- telnyx/types/call_streaming_started_webhook_event1.py +53 -0
- telnyx/types/call_streaming_stopped_webhook_event1.py +53 -0
- 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 +160 -6
- 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 +161 -6
- telnyx/types/campaign_status_update_webhook_event1.py +26 -0
- telnyx/types/conference_created_webhook_event1.py +53 -0
- telnyx/types/conference_ended_webhook_event1.py +56 -0
- telnyx/types/conference_floor_changed_webhook_event1.py +45 -0
- telnyx/types/conference_participant_joined_webhook_event1.py +53 -0
- telnyx/types/conference_participant_left_webhook_event1.py +53 -0
- telnyx/types/conference_participant_playback_ended_webhook_event1.py +65 -0
- telnyx/types/conference_participant_playback_started_webhook_event1.py +65 -0
- telnyx/types/conference_participant_speak_ended_webhook_event1.py +56 -0
- telnyx/types/conference_participant_speak_started_webhook_event1.py +56 -0
- telnyx/types/conference_playback_ended_webhook_event1.py +49 -0
- telnyx/types/conference_playback_started_webhook_event1.py +49 -0
- telnyx/types/conference_recording_saved_webhook_event1.py +103 -0
- telnyx/types/conference_speak_ended_webhook_event1.py +40 -0
- telnyx/types/conference_speak_started_webhook_event1.py +40 -0
- telnyx/types/country_coverage_retrieve_country_response.py +7 -0
- telnyx/types/country_coverage_retrieve_response.py +7 -0
- telnyx/types/customer_service_record_status_changed_webhook_event1.py +55 -0
- telnyx/types/delivery_update_webhook_event1.py +40 -0
- telnyx/types/document_upload_json_params.py +39 -0
- telnyx/types/document_upload_json_response.py +12 -0
- telnyx/types/fax_delivered_webhook_event1.py +69 -0
- telnyx/types/fax_failed_webhook_event1.py +66 -0
- telnyx/types/fax_media_processed_webhook_event1.py +63 -0
- telnyx/types/fax_queued_webhook_event1.py +63 -0
- telnyx/types/fax_sending_started_webhook_event1.py +63 -0
- telnyx/types/inbound_message_webhook_event1.py +227 -0
- telnyx/types/legacy/reporting/__init__.py +2 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +4 -0
- telnyx/types/legacy/reporting/batch_detail_records/batch_csv_pagination_meta.py +17 -0
- telnyx/types/legacy/reporting/batch_detail_records/cdr_detailed_req_response.py +63 -0
- telnyx/types/legacy/reporting/batch_detail_records/mdr_detail_report_response.py +42 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +4 -26
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +5 -70
- telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/stt_detail_report_response.py +27 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +4 -26
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +4 -82
- telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +4 -82
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +5 -92
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +4 -82
- telnyx/types/legacy/reporting/filter.py +31 -0
- telnyx/types/legacy/reporting/filter_param.py +30 -0
- telnyx/types/legacy/reporting/usage_reports/__init__.py +3 -0
- telnyx/types/legacy/reporting/usage_reports/cdr_usage_report_response_legacy.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/mdr_usage_report_response_legacy.py +38 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +5 -44
- telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/standard_pagination_meta.py +17 -0
- telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +4 -39
- telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +4 -39
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +5 -49
- telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +4 -39
- telnyx/types/message_template.py +12 -0
- telnyx/types/messaging_profile.py +3 -0
- telnyx/types/messaging_profile_create_params.py +3 -0
- telnyx/types/messaging_profile_update_params.py +3 -0
- telnyx/types/messaging_tollfree/verification/__init__.py +1 -0
- telnyx/types/messaging_tollfree/verification/request_create_params.py +51 -1
- telnyx/types/messaging_tollfree/verification/request_update_params.py +51 -1
- telnyx/types/messaging_tollfree/verification/toll_free_verification_entity_type.py +9 -0
- telnyx/types/messaging_tollfree/verification/verification_request_egress.py +24 -0
- telnyx/types/messaging_tollfree/verification/verification_request_status.py +24 -0
- telnyx/types/number_order_status_update_webhook_event1.py +38 -0
- telnyx/types/oauth_client.py +59 -0
- telnyx/types/oauth_client_create_response.py +4 -55
- telnyx/types/oauth_client_list_response.py +5 -69
- telnyx/types/oauth_client_retrieve_response.py +4 -55
- telnyx/types/oauth_client_update_response.py +4 -55
- telnyx/types/oauth_grant.py +29 -0
- telnyx/types/oauth_grant_delete_response.py +4 -25
- telnyx/types/oauth_grant_list_response.py +5 -39
- telnyx/types/oauth_grant_retrieve_response.py +4 -25
- telnyx/types/outbound_voice_profile.py +27 -1
- telnyx/types/outbound_voice_profile_create_params.py +27 -1
- telnyx/types/outbound_voice_profile_list_params.py +1 -1
- telnyx/types/outbound_voice_profile_update_params.py +27 -1
- 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/replaced_link_click_webhook_event1.py +32 -0
- 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/requirement_group.py +2 -2
- telnyx/types/requirement_group_list_params.py +1 -1
- telnyx/types/shared/__init__.py +1 -0
- telnyx/types/{api_error.py → shared/api_error.py} +1 -1
- telnyx/types/stream_bidirectional_sampling_rate.py +7 -0
- telnyx/types/streaming_failed_webhook_event1.py +70 -0
- telnyx/types/streaming_started_webhook_event1.py +53 -0
- telnyx/types/streaming_stopped_webhook_event1.py +53 -0
- telnyx/types/texml/accounts/call_calls_params.py +16 -1
- telnyx/types/texml/accounts/conferences/participant_participants_params.py +16 -1
- telnyx/types/transcription_webhook_event1.py +72 -0
- telnyx/types/unsafe_unwrap_webhook_event.py +138 -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/verified_number_create_params.py +10 -0
- telnyx/types/verify_profile.py +18 -3
- telnyx/types/verify_profile_list_response.py +4 -13
- telnyx/types/{verify_profile_create_template_response.py → verify_profile_message_template_response.py} +2 -6
- telnyx/types/verify_profile_retrieve_templates_response.py +4 -9
- {telnyx-3.7.0a0.dist-info → telnyx-3.9.0.dist-info}/METADATA +9 -5
- {telnyx-3.7.0a0.dist-info → telnyx-3.9.0.dist-info}/RECORD +202 -128
- 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/client_create_bucket_params.py +0 -13
- telnyx/types/client_delete_objects_params.py +0 -20
- telnyx/types/client_get_object_params.py +0 -15
- telnyx/types/client_list_objects_params.py +0 -13
- telnyx/types/client_put_object_params.py +0 -20
- telnyx/types/list_buckets_response.py +0 -20
- telnyx/types/list_objects_response.py +0 -24
- telnyx/types/verify_profile_update_template_response.py +0 -17
- {telnyx-3.7.0a0.dist-info → telnyx-3.9.0.dist-info}/WHEEL +0 -0
- {telnyx-3.7.0a0.dist-info → telnyx-3.9.0.dist-info}/licenses/LICENSE +0 -0
telnyx/_client.py
CHANGED
|
@@ -3,56 +3,24 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any, Mapping
|
|
7
|
-
from typing_extensions import Self,
|
|
6
|
+
from typing import Any, Mapping
|
|
7
|
+
from typing_extensions import Self, override
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
11
|
from . import _exceptions
|
|
12
12
|
from ._qs import Querystring
|
|
13
|
-
from .types import (
|
|
14
|
-
client_get_object_params,
|
|
15
|
-
client_put_object_params,
|
|
16
|
-
client_list_objects_params,
|
|
17
|
-
client_create_bucket_params,
|
|
18
|
-
client_delete_objects_params,
|
|
19
|
-
)
|
|
20
13
|
from ._types import (
|
|
21
|
-
Body,
|
|
22
14
|
Omit,
|
|
23
|
-
Query,
|
|
24
|
-
Headers,
|
|
25
15
|
Timeout,
|
|
26
|
-
NoneType,
|
|
27
16
|
NotGiven,
|
|
28
|
-
FileTypes,
|
|
29
17
|
Transport,
|
|
30
18
|
ProxiesTypes,
|
|
31
19
|
RequestOptions,
|
|
32
|
-
omit,
|
|
33
20
|
not_given,
|
|
34
21
|
)
|
|
35
|
-
from ._utils import
|
|
36
|
-
is_given,
|
|
37
|
-
maybe_transform,
|
|
38
|
-
get_async_library,
|
|
39
|
-
async_maybe_transform,
|
|
40
|
-
)
|
|
22
|
+
from ._utils import is_given, get_async_library
|
|
41
23
|
from ._version import __version__
|
|
42
|
-
from ._response import (
|
|
43
|
-
BinaryAPIResponse,
|
|
44
|
-
AsyncBinaryAPIResponse,
|
|
45
|
-
StreamedBinaryAPIResponse,
|
|
46
|
-
AsyncStreamedBinaryAPIResponse,
|
|
47
|
-
to_raw_response_wrapper,
|
|
48
|
-
to_streamed_response_wrapper,
|
|
49
|
-
async_to_raw_response_wrapper,
|
|
50
|
-
to_custom_raw_response_wrapper,
|
|
51
|
-
async_to_streamed_response_wrapper,
|
|
52
|
-
to_custom_streamed_response_wrapper,
|
|
53
|
-
async_to_custom_raw_response_wrapper,
|
|
54
|
-
async_to_custom_streamed_response_wrapper,
|
|
55
|
-
)
|
|
56
24
|
from .resources import (
|
|
57
25
|
ips,
|
|
58
26
|
enum,
|
|
@@ -174,7 +142,6 @@ from ._base_client import (
|
|
|
174
142
|
DEFAULT_MAX_RETRIES,
|
|
175
143
|
SyncAPIClient,
|
|
176
144
|
AsyncAPIClient,
|
|
177
|
-
make_request_options,
|
|
178
145
|
)
|
|
179
146
|
from .resources.ai import ai
|
|
180
147
|
from .resources.brand import brand
|
|
@@ -208,8 +175,6 @@ from .resources.campaign_builder import campaign_builder
|
|
|
208
175
|
from .resources.managed_accounts import managed_accounts
|
|
209
176
|
from .resources.operator_connect import operator_connect
|
|
210
177
|
from .resources.verified_numbers import verified_numbers
|
|
211
|
-
from .types.list_buckets_response import ListBucketsResponse
|
|
212
|
-
from .types.list_objects_response import ListObjectsResponse
|
|
213
178
|
from .resources.messaging_profiles import messaging_profiles
|
|
214
179
|
from .resources.messaging_tollfree import messaging_tollfree
|
|
215
180
|
from .resources.number_reservations import number_reservations
|
|
@@ -381,11 +346,13 @@ class Telnyx(SyncAPIClient):
|
|
|
381
346
|
|
|
382
347
|
# client options
|
|
383
348
|
api_key: str
|
|
349
|
+
public_key: str | None
|
|
384
350
|
|
|
385
351
|
def __init__(
|
|
386
352
|
self,
|
|
387
353
|
*,
|
|
388
354
|
api_key: str | None = None,
|
|
355
|
+
public_key: str | None = None,
|
|
389
356
|
base_url: str | httpx.URL | None = None,
|
|
390
357
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
391
358
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -407,7 +374,9 @@ class Telnyx(SyncAPIClient):
|
|
|
407
374
|
) -> None:
|
|
408
375
|
"""Construct a new synchronous Telnyx client instance.
|
|
409
376
|
|
|
410
|
-
This automatically infers the
|
|
377
|
+
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
|
|
378
|
+
- `api_key` from `TELNYX_API_KEY`
|
|
379
|
+
- `public_key` from `TELNYX_PUBLIC_KEY`
|
|
411
380
|
"""
|
|
412
381
|
if api_key is None:
|
|
413
382
|
api_key = os.environ.get("TELNYX_API_KEY")
|
|
@@ -417,6 +386,10 @@ class Telnyx(SyncAPIClient):
|
|
|
417
386
|
)
|
|
418
387
|
self.api_key = api_key
|
|
419
388
|
|
|
389
|
+
if public_key is None:
|
|
390
|
+
public_key = os.environ.get("TELNYX_PUBLIC_KEY")
|
|
391
|
+
self.public_key = public_key
|
|
392
|
+
|
|
420
393
|
if base_url is None:
|
|
421
394
|
base_url = os.environ.get("TELNYX_BASE_URL")
|
|
422
395
|
self._base_url_overridden = base_url is not None
|
|
@@ -621,6 +594,7 @@ class Telnyx(SyncAPIClient):
|
|
|
621
594
|
self,
|
|
622
595
|
*,
|
|
623
596
|
api_key: str | None = None,
|
|
597
|
+
public_key: str | None = None,
|
|
624
598
|
base_url: str | httpx.URL | None = None,
|
|
625
599
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
626
600
|
http_client: httpx.Client | None = None,
|
|
@@ -655,6 +629,7 @@ class Telnyx(SyncAPIClient):
|
|
|
655
629
|
http_client = http_client or self._client
|
|
656
630
|
client = self.__class__(
|
|
657
631
|
api_key=api_key or self.api_key,
|
|
632
|
+
public_key=public_key or self.public_key,
|
|
658
633
|
base_url=base_url or self.base_url,
|
|
659
634
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
660
635
|
http_client=http_client,
|
|
@@ -670,309 +645,6 @@ class Telnyx(SyncAPIClient):
|
|
|
670
645
|
# client.with_options(timeout=10).foo.create(...)
|
|
671
646
|
with_options = copy
|
|
672
647
|
|
|
673
|
-
def create_bucket(
|
|
674
|
-
self,
|
|
675
|
-
bucket_name: str,
|
|
676
|
-
*,
|
|
677
|
-
location_constraint: str | Omit = omit,
|
|
678
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
679
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
680
|
-
extra_headers: Headers | None = None,
|
|
681
|
-
extra_query: Query | None = None,
|
|
682
|
-
extra_body: Body | None = None,
|
|
683
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
684
|
-
) -> None:
|
|
685
|
-
"""
|
|
686
|
-
Create a bucket.
|
|
687
|
-
|
|
688
|
-
Args:
|
|
689
|
-
extra_headers: Send extra headers
|
|
690
|
-
|
|
691
|
-
extra_query: Add additional query parameters to the request
|
|
692
|
-
|
|
693
|
-
extra_body: Add additional JSON properties to the request
|
|
694
|
-
|
|
695
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
696
|
-
"""
|
|
697
|
-
if not bucket_name:
|
|
698
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
699
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
700
|
-
return self.put(
|
|
701
|
-
f"/{bucket_name}",
|
|
702
|
-
body=maybe_transform(
|
|
703
|
-
{"location_constraint": location_constraint}, client_create_bucket_params.ClientCreateBucketParams
|
|
704
|
-
),
|
|
705
|
-
options=make_request_options(
|
|
706
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
707
|
-
),
|
|
708
|
-
cast_to=NoneType,
|
|
709
|
-
)
|
|
710
|
-
|
|
711
|
-
def delete_bucket(
|
|
712
|
-
self,
|
|
713
|
-
bucket_name: str,
|
|
714
|
-
*,
|
|
715
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
716
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
717
|
-
extra_headers: Headers | None = None,
|
|
718
|
-
extra_query: Query | None = None,
|
|
719
|
-
extra_body: Body | None = None,
|
|
720
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
721
|
-
) -> None:
|
|
722
|
-
"""Deletes a bucket.
|
|
723
|
-
|
|
724
|
-
The bucket must be empty for it to be deleted.
|
|
725
|
-
|
|
726
|
-
Args:
|
|
727
|
-
extra_headers: Send extra headers
|
|
728
|
-
|
|
729
|
-
extra_query: Add additional query parameters to the request
|
|
730
|
-
|
|
731
|
-
extra_body: Add additional JSON properties to the request
|
|
732
|
-
|
|
733
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
734
|
-
"""
|
|
735
|
-
if not bucket_name:
|
|
736
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
737
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
738
|
-
return self.delete(
|
|
739
|
-
f"/{bucket_name}",
|
|
740
|
-
options=make_request_options(
|
|
741
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
742
|
-
),
|
|
743
|
-
cast_to=NoneType,
|
|
744
|
-
)
|
|
745
|
-
|
|
746
|
-
def delete_object(
|
|
747
|
-
self,
|
|
748
|
-
object_name: str,
|
|
749
|
-
*,
|
|
750
|
-
bucket_name: str,
|
|
751
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
752
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
753
|
-
extra_headers: Headers | None = None,
|
|
754
|
-
extra_query: Query | None = None,
|
|
755
|
-
extra_body: Body | None = None,
|
|
756
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
757
|
-
) -> None:
|
|
758
|
-
"""
|
|
759
|
-
Delete an object from a given bucket.
|
|
760
|
-
|
|
761
|
-
Args:
|
|
762
|
-
extra_headers: Send extra headers
|
|
763
|
-
|
|
764
|
-
extra_query: Add additional query parameters to the request
|
|
765
|
-
|
|
766
|
-
extra_body: Add additional JSON properties to the request
|
|
767
|
-
|
|
768
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
769
|
-
"""
|
|
770
|
-
if not bucket_name:
|
|
771
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
772
|
-
if not object_name:
|
|
773
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
774
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
775
|
-
return self.delete(
|
|
776
|
-
f"/{bucket_name}/{object_name}",
|
|
777
|
-
options=make_request_options(
|
|
778
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
779
|
-
),
|
|
780
|
-
cast_to=NoneType,
|
|
781
|
-
)
|
|
782
|
-
|
|
783
|
-
def delete_objects(
|
|
784
|
-
self,
|
|
785
|
-
bucket_name: str,
|
|
786
|
-
*,
|
|
787
|
-
delete: Literal[True],
|
|
788
|
-
body: Iterable[client_delete_objects_params.Body],
|
|
789
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
790
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
791
|
-
extra_headers: Headers | None = None,
|
|
792
|
-
extra_query: Query | None = None,
|
|
793
|
-
extra_body: Body | None = None,
|
|
794
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
795
|
-
) -> object:
|
|
796
|
-
"""
|
|
797
|
-
Deletes one or multiple objects from a given bucket.
|
|
798
|
-
|
|
799
|
-
Args:
|
|
800
|
-
extra_headers: Send extra headers
|
|
801
|
-
|
|
802
|
-
extra_query: Add additional query parameters to the request
|
|
803
|
-
|
|
804
|
-
extra_body: Add additional JSON properties to the request
|
|
805
|
-
|
|
806
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
807
|
-
"""
|
|
808
|
-
if not bucket_name:
|
|
809
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
810
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
811
|
-
return self.post(
|
|
812
|
-
f"/{bucket_name}",
|
|
813
|
-
body=maybe_transform(body, Iterable[client_delete_objects_params.Body]),
|
|
814
|
-
options=make_request_options(
|
|
815
|
-
extra_headers=extra_headers,
|
|
816
|
-
extra_query=extra_query,
|
|
817
|
-
extra_body=extra_body,
|
|
818
|
-
timeout=timeout,
|
|
819
|
-
query=maybe_transform({"delete": delete}, client_delete_objects_params.ClientDeleteObjectsParams),
|
|
820
|
-
),
|
|
821
|
-
cast_to=object,
|
|
822
|
-
)
|
|
823
|
-
|
|
824
|
-
def get_object(
|
|
825
|
-
self,
|
|
826
|
-
object_name: str,
|
|
827
|
-
*,
|
|
828
|
-
bucket_name: str,
|
|
829
|
-
upload_id: str | Omit = omit,
|
|
830
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
831
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
832
|
-
extra_headers: Headers | None = None,
|
|
833
|
-
extra_query: Query | None = None,
|
|
834
|
-
extra_body: Body | None = None,
|
|
835
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
836
|
-
) -> BinaryAPIResponse:
|
|
837
|
-
"""
|
|
838
|
-
Retrieves an object from a given bucket.
|
|
839
|
-
|
|
840
|
-
Args:
|
|
841
|
-
extra_headers: Send extra headers
|
|
842
|
-
|
|
843
|
-
extra_query: Add additional query parameters to the request
|
|
844
|
-
|
|
845
|
-
extra_body: Add additional JSON properties to the request
|
|
846
|
-
|
|
847
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
848
|
-
"""
|
|
849
|
-
if not bucket_name:
|
|
850
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
851
|
-
if not object_name:
|
|
852
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
853
|
-
extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
|
|
854
|
-
return self.get(
|
|
855
|
-
f"/{bucket_name}/{object_name}",
|
|
856
|
-
options=make_request_options(
|
|
857
|
-
extra_headers=extra_headers,
|
|
858
|
-
extra_query=extra_query,
|
|
859
|
-
extra_body=extra_body,
|
|
860
|
-
timeout=timeout,
|
|
861
|
-
query=maybe_transform({"upload_id": upload_id}, client_get_object_params.ClientGetObjectParams),
|
|
862
|
-
),
|
|
863
|
-
cast_to=BinaryAPIResponse,
|
|
864
|
-
)
|
|
865
|
-
|
|
866
|
-
def list_buckets(
|
|
867
|
-
self,
|
|
868
|
-
*,
|
|
869
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
870
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
871
|
-
extra_headers: Headers | None = None,
|
|
872
|
-
extra_query: Query | None = None,
|
|
873
|
-
extra_body: Body | None = None,
|
|
874
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
875
|
-
) -> ListBucketsResponse:
|
|
876
|
-
"""List all Buckets."""
|
|
877
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
878
|
-
return self.get(
|
|
879
|
-
"/",
|
|
880
|
-
options=make_request_options(
|
|
881
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
882
|
-
),
|
|
883
|
-
cast_to=ListBucketsResponse,
|
|
884
|
-
)
|
|
885
|
-
|
|
886
|
-
def list_objects(
|
|
887
|
-
self,
|
|
888
|
-
bucket_name: str,
|
|
889
|
-
*,
|
|
890
|
-
list_type: Literal[2] | Omit = omit,
|
|
891
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
892
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
893
|
-
extra_headers: Headers | None = None,
|
|
894
|
-
extra_query: Query | None = None,
|
|
895
|
-
extra_body: Body | None = None,
|
|
896
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
897
|
-
) -> ListObjectsResponse:
|
|
898
|
-
"""
|
|
899
|
-
List all objects contained in a given bucket.
|
|
900
|
-
|
|
901
|
-
Args:
|
|
902
|
-
extra_headers: Send extra headers
|
|
903
|
-
|
|
904
|
-
extra_query: Add additional query parameters to the request
|
|
905
|
-
|
|
906
|
-
extra_body: Add additional JSON properties to the request
|
|
907
|
-
|
|
908
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
909
|
-
"""
|
|
910
|
-
if not bucket_name:
|
|
911
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
912
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
913
|
-
return self.get(
|
|
914
|
-
f"/{bucket_name}",
|
|
915
|
-
options=make_request_options(
|
|
916
|
-
extra_headers=extra_headers,
|
|
917
|
-
extra_query=extra_query,
|
|
918
|
-
extra_body=extra_body,
|
|
919
|
-
timeout=timeout,
|
|
920
|
-
query=maybe_transform({"list_type": list_type}, client_list_objects_params.ClientListObjectsParams),
|
|
921
|
-
),
|
|
922
|
-
cast_to=ListObjectsResponse,
|
|
923
|
-
)
|
|
924
|
-
|
|
925
|
-
def put_object(
|
|
926
|
-
self,
|
|
927
|
-
object_name: str,
|
|
928
|
-
*,
|
|
929
|
-
bucket_name: str,
|
|
930
|
-
body: FileTypes,
|
|
931
|
-
part_number: str | Omit = omit,
|
|
932
|
-
upload_id: str | Omit = omit,
|
|
933
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
934
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
935
|
-
extra_headers: Headers | None = None,
|
|
936
|
-
extra_query: Query | None = None,
|
|
937
|
-
extra_body: Body | None = None,
|
|
938
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
939
|
-
) -> None:
|
|
940
|
-
"""
|
|
941
|
-
Add an object to a bucket.
|
|
942
|
-
|
|
943
|
-
Args:
|
|
944
|
-
extra_headers: Send extra headers
|
|
945
|
-
|
|
946
|
-
extra_query: Add additional query parameters to the request
|
|
947
|
-
|
|
948
|
-
extra_body: Add additional JSON properties to the request
|
|
949
|
-
|
|
950
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
951
|
-
"""
|
|
952
|
-
if not bucket_name:
|
|
953
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
954
|
-
if not object_name:
|
|
955
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
956
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
957
|
-
return self.put(
|
|
958
|
-
f"/{bucket_name}/{object_name}",
|
|
959
|
-
body=maybe_transform(body, client_put_object_params.ClientPutObjectParams),
|
|
960
|
-
options=make_request_options(
|
|
961
|
-
extra_headers=extra_headers,
|
|
962
|
-
extra_query=extra_query,
|
|
963
|
-
extra_body=extra_body,
|
|
964
|
-
timeout=timeout,
|
|
965
|
-
query=maybe_transform(
|
|
966
|
-
{
|
|
967
|
-
"part_number": part_number,
|
|
968
|
-
"upload_id": upload_id,
|
|
969
|
-
},
|
|
970
|
-
client_put_object_params.ClientPutObjectParams,
|
|
971
|
-
),
|
|
972
|
-
),
|
|
973
|
-
cast_to=NoneType,
|
|
974
|
-
)
|
|
975
|
-
|
|
976
648
|
@override
|
|
977
649
|
def _make_status_error(
|
|
978
650
|
self,
|
|
@@ -1167,11 +839,13 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1167
839
|
|
|
1168
840
|
# client options
|
|
1169
841
|
api_key: str
|
|
842
|
+
public_key: str | None
|
|
1170
843
|
|
|
1171
844
|
def __init__(
|
|
1172
845
|
self,
|
|
1173
846
|
*,
|
|
1174
847
|
api_key: str | None = None,
|
|
848
|
+
public_key: str | None = None,
|
|
1175
849
|
base_url: str | httpx.URL | None = None,
|
|
1176
850
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1177
851
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -1193,7 +867,9 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1193
867
|
) -> None:
|
|
1194
868
|
"""Construct a new async AsyncTelnyx client instance.
|
|
1195
869
|
|
|
1196
|
-
This automatically infers the
|
|
870
|
+
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
|
|
871
|
+
- `api_key` from `TELNYX_API_KEY`
|
|
872
|
+
- `public_key` from `TELNYX_PUBLIC_KEY`
|
|
1197
873
|
"""
|
|
1198
874
|
if api_key is None:
|
|
1199
875
|
api_key = os.environ.get("TELNYX_API_KEY")
|
|
@@ -1203,6 +879,10 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1203
879
|
)
|
|
1204
880
|
self.api_key = api_key
|
|
1205
881
|
|
|
882
|
+
if public_key is None:
|
|
883
|
+
public_key = os.environ.get("TELNYX_PUBLIC_KEY")
|
|
884
|
+
self.public_key = public_key
|
|
885
|
+
|
|
1206
886
|
if base_url is None:
|
|
1207
887
|
base_url = os.environ.get("TELNYX_BASE_URL")
|
|
1208
888
|
self._base_url_overridden = base_url is not None
|
|
@@ -1413,6 +1093,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1413
1093
|
self,
|
|
1414
1094
|
*,
|
|
1415
1095
|
api_key: str | None = None,
|
|
1096
|
+
public_key: str | None = None,
|
|
1416
1097
|
base_url: str | httpx.URL | None = None,
|
|
1417
1098
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1418
1099
|
http_client: httpx.AsyncClient | None = None,
|
|
@@ -1447,6 +1128,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1447
1128
|
http_client = http_client or self._client
|
|
1448
1129
|
client = self.__class__(
|
|
1449
1130
|
api_key=api_key or self.api_key,
|
|
1131
|
+
public_key=public_key or self.public_key,
|
|
1450
1132
|
base_url=base_url or self.base_url,
|
|
1451
1133
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
1452
1134
|
http_client=http_client,
|
|
@@ -1462,315 +1144,6 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1462
1144
|
# client.with_options(timeout=10).foo.create(...)
|
|
1463
1145
|
with_options = copy
|
|
1464
1146
|
|
|
1465
|
-
async def create_bucket(
|
|
1466
|
-
self,
|
|
1467
|
-
bucket_name: str,
|
|
1468
|
-
*,
|
|
1469
|
-
location_constraint: str | Omit = omit,
|
|
1470
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1471
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1472
|
-
extra_headers: Headers | None = None,
|
|
1473
|
-
extra_query: Query | None = None,
|
|
1474
|
-
extra_body: Body | None = None,
|
|
1475
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1476
|
-
) -> None:
|
|
1477
|
-
"""
|
|
1478
|
-
Create a bucket.
|
|
1479
|
-
|
|
1480
|
-
Args:
|
|
1481
|
-
extra_headers: Send extra headers
|
|
1482
|
-
|
|
1483
|
-
extra_query: Add additional query parameters to the request
|
|
1484
|
-
|
|
1485
|
-
extra_body: Add additional JSON properties to the request
|
|
1486
|
-
|
|
1487
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1488
|
-
"""
|
|
1489
|
-
if not bucket_name:
|
|
1490
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1491
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1492
|
-
return await self.put(
|
|
1493
|
-
f"/{bucket_name}",
|
|
1494
|
-
body=await async_maybe_transform(
|
|
1495
|
-
{"location_constraint": location_constraint}, client_create_bucket_params.ClientCreateBucketParams
|
|
1496
|
-
),
|
|
1497
|
-
options=make_request_options(
|
|
1498
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1499
|
-
),
|
|
1500
|
-
cast_to=NoneType,
|
|
1501
|
-
)
|
|
1502
|
-
|
|
1503
|
-
async def delete_bucket(
|
|
1504
|
-
self,
|
|
1505
|
-
bucket_name: str,
|
|
1506
|
-
*,
|
|
1507
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1508
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1509
|
-
extra_headers: Headers | None = None,
|
|
1510
|
-
extra_query: Query | None = None,
|
|
1511
|
-
extra_body: Body | None = None,
|
|
1512
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1513
|
-
) -> None:
|
|
1514
|
-
"""Deletes a bucket.
|
|
1515
|
-
|
|
1516
|
-
The bucket must be empty for it to be deleted.
|
|
1517
|
-
|
|
1518
|
-
Args:
|
|
1519
|
-
extra_headers: Send extra headers
|
|
1520
|
-
|
|
1521
|
-
extra_query: Add additional query parameters to the request
|
|
1522
|
-
|
|
1523
|
-
extra_body: Add additional JSON properties to the request
|
|
1524
|
-
|
|
1525
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1526
|
-
"""
|
|
1527
|
-
if not bucket_name:
|
|
1528
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1529
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1530
|
-
return await self.delete(
|
|
1531
|
-
f"/{bucket_name}",
|
|
1532
|
-
options=make_request_options(
|
|
1533
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1534
|
-
),
|
|
1535
|
-
cast_to=NoneType,
|
|
1536
|
-
)
|
|
1537
|
-
|
|
1538
|
-
async def delete_object(
|
|
1539
|
-
self,
|
|
1540
|
-
object_name: str,
|
|
1541
|
-
*,
|
|
1542
|
-
bucket_name: str,
|
|
1543
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1544
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1545
|
-
extra_headers: Headers | None = None,
|
|
1546
|
-
extra_query: Query | None = None,
|
|
1547
|
-
extra_body: Body | None = None,
|
|
1548
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1549
|
-
) -> None:
|
|
1550
|
-
"""
|
|
1551
|
-
Delete an object from a given bucket.
|
|
1552
|
-
|
|
1553
|
-
Args:
|
|
1554
|
-
extra_headers: Send extra headers
|
|
1555
|
-
|
|
1556
|
-
extra_query: Add additional query parameters to the request
|
|
1557
|
-
|
|
1558
|
-
extra_body: Add additional JSON properties to the request
|
|
1559
|
-
|
|
1560
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1561
|
-
"""
|
|
1562
|
-
if not bucket_name:
|
|
1563
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1564
|
-
if not object_name:
|
|
1565
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1566
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1567
|
-
return await self.delete(
|
|
1568
|
-
f"/{bucket_name}/{object_name}",
|
|
1569
|
-
options=make_request_options(
|
|
1570
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1571
|
-
),
|
|
1572
|
-
cast_to=NoneType,
|
|
1573
|
-
)
|
|
1574
|
-
|
|
1575
|
-
async def delete_objects(
|
|
1576
|
-
self,
|
|
1577
|
-
bucket_name: str,
|
|
1578
|
-
*,
|
|
1579
|
-
delete: Literal[True],
|
|
1580
|
-
body: Iterable[client_delete_objects_params.Body],
|
|
1581
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1582
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1583
|
-
extra_headers: Headers | None = None,
|
|
1584
|
-
extra_query: Query | None = None,
|
|
1585
|
-
extra_body: Body | None = None,
|
|
1586
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1587
|
-
) -> object:
|
|
1588
|
-
"""
|
|
1589
|
-
Deletes one or multiple objects from a given bucket.
|
|
1590
|
-
|
|
1591
|
-
Args:
|
|
1592
|
-
extra_headers: Send extra headers
|
|
1593
|
-
|
|
1594
|
-
extra_query: Add additional query parameters to the request
|
|
1595
|
-
|
|
1596
|
-
extra_body: Add additional JSON properties to the request
|
|
1597
|
-
|
|
1598
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1599
|
-
"""
|
|
1600
|
-
if not bucket_name:
|
|
1601
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1602
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1603
|
-
return await self.post(
|
|
1604
|
-
f"/{bucket_name}",
|
|
1605
|
-
body=await async_maybe_transform(body, Iterable[client_delete_objects_params.Body]),
|
|
1606
|
-
options=make_request_options(
|
|
1607
|
-
extra_headers=extra_headers,
|
|
1608
|
-
extra_query=extra_query,
|
|
1609
|
-
extra_body=extra_body,
|
|
1610
|
-
timeout=timeout,
|
|
1611
|
-
query=await async_maybe_transform(
|
|
1612
|
-
{"delete": delete}, client_delete_objects_params.ClientDeleteObjectsParams
|
|
1613
|
-
),
|
|
1614
|
-
),
|
|
1615
|
-
cast_to=object,
|
|
1616
|
-
)
|
|
1617
|
-
|
|
1618
|
-
async def get_object(
|
|
1619
|
-
self,
|
|
1620
|
-
object_name: str,
|
|
1621
|
-
*,
|
|
1622
|
-
bucket_name: str,
|
|
1623
|
-
upload_id: str | Omit = omit,
|
|
1624
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1625
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1626
|
-
extra_headers: Headers | None = None,
|
|
1627
|
-
extra_query: Query | None = None,
|
|
1628
|
-
extra_body: Body | None = None,
|
|
1629
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1630
|
-
) -> AsyncBinaryAPIResponse:
|
|
1631
|
-
"""
|
|
1632
|
-
Retrieves an object from a given bucket.
|
|
1633
|
-
|
|
1634
|
-
Args:
|
|
1635
|
-
extra_headers: Send extra headers
|
|
1636
|
-
|
|
1637
|
-
extra_query: Add additional query parameters to the request
|
|
1638
|
-
|
|
1639
|
-
extra_body: Add additional JSON properties to the request
|
|
1640
|
-
|
|
1641
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1642
|
-
"""
|
|
1643
|
-
if not bucket_name:
|
|
1644
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1645
|
-
if not object_name:
|
|
1646
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1647
|
-
extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
|
|
1648
|
-
return await self.get(
|
|
1649
|
-
f"/{bucket_name}/{object_name}",
|
|
1650
|
-
options=make_request_options(
|
|
1651
|
-
extra_headers=extra_headers,
|
|
1652
|
-
extra_query=extra_query,
|
|
1653
|
-
extra_body=extra_body,
|
|
1654
|
-
timeout=timeout,
|
|
1655
|
-
query=await async_maybe_transform(
|
|
1656
|
-
{"upload_id": upload_id}, client_get_object_params.ClientGetObjectParams
|
|
1657
|
-
),
|
|
1658
|
-
),
|
|
1659
|
-
cast_to=AsyncBinaryAPIResponse,
|
|
1660
|
-
)
|
|
1661
|
-
|
|
1662
|
-
async def list_buckets(
|
|
1663
|
-
self,
|
|
1664
|
-
*,
|
|
1665
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1666
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1667
|
-
extra_headers: Headers | None = None,
|
|
1668
|
-
extra_query: Query | None = None,
|
|
1669
|
-
extra_body: Body | None = None,
|
|
1670
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1671
|
-
) -> ListBucketsResponse:
|
|
1672
|
-
"""List all Buckets."""
|
|
1673
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1674
|
-
return await self.get(
|
|
1675
|
-
"/",
|
|
1676
|
-
options=make_request_options(
|
|
1677
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1678
|
-
),
|
|
1679
|
-
cast_to=ListBucketsResponse,
|
|
1680
|
-
)
|
|
1681
|
-
|
|
1682
|
-
async def list_objects(
|
|
1683
|
-
self,
|
|
1684
|
-
bucket_name: str,
|
|
1685
|
-
*,
|
|
1686
|
-
list_type: Literal[2] | Omit = omit,
|
|
1687
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1688
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1689
|
-
extra_headers: Headers | None = None,
|
|
1690
|
-
extra_query: Query | None = None,
|
|
1691
|
-
extra_body: Body | None = None,
|
|
1692
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1693
|
-
) -> ListObjectsResponse:
|
|
1694
|
-
"""
|
|
1695
|
-
List all objects contained in a given bucket.
|
|
1696
|
-
|
|
1697
|
-
Args:
|
|
1698
|
-
extra_headers: Send extra headers
|
|
1699
|
-
|
|
1700
|
-
extra_query: Add additional query parameters to the request
|
|
1701
|
-
|
|
1702
|
-
extra_body: Add additional JSON properties to the request
|
|
1703
|
-
|
|
1704
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1705
|
-
"""
|
|
1706
|
-
if not bucket_name:
|
|
1707
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1708
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1709
|
-
return await self.get(
|
|
1710
|
-
f"/{bucket_name}",
|
|
1711
|
-
options=make_request_options(
|
|
1712
|
-
extra_headers=extra_headers,
|
|
1713
|
-
extra_query=extra_query,
|
|
1714
|
-
extra_body=extra_body,
|
|
1715
|
-
timeout=timeout,
|
|
1716
|
-
query=await async_maybe_transform(
|
|
1717
|
-
{"list_type": list_type}, client_list_objects_params.ClientListObjectsParams
|
|
1718
|
-
),
|
|
1719
|
-
),
|
|
1720
|
-
cast_to=ListObjectsResponse,
|
|
1721
|
-
)
|
|
1722
|
-
|
|
1723
|
-
async def put_object(
|
|
1724
|
-
self,
|
|
1725
|
-
object_name: str,
|
|
1726
|
-
*,
|
|
1727
|
-
bucket_name: str,
|
|
1728
|
-
body: FileTypes,
|
|
1729
|
-
part_number: str | Omit = omit,
|
|
1730
|
-
upload_id: str | Omit = omit,
|
|
1731
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1732
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1733
|
-
extra_headers: Headers | None = None,
|
|
1734
|
-
extra_query: Query | None = None,
|
|
1735
|
-
extra_body: Body | None = None,
|
|
1736
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1737
|
-
) -> None:
|
|
1738
|
-
"""
|
|
1739
|
-
Add an object to a bucket.
|
|
1740
|
-
|
|
1741
|
-
Args:
|
|
1742
|
-
extra_headers: Send extra headers
|
|
1743
|
-
|
|
1744
|
-
extra_query: Add additional query parameters to the request
|
|
1745
|
-
|
|
1746
|
-
extra_body: Add additional JSON properties to the request
|
|
1747
|
-
|
|
1748
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1749
|
-
"""
|
|
1750
|
-
if not bucket_name:
|
|
1751
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1752
|
-
if not object_name:
|
|
1753
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1754
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1755
|
-
return await self.put(
|
|
1756
|
-
f"/{bucket_name}/{object_name}",
|
|
1757
|
-
body=await async_maybe_transform(body, client_put_object_params.ClientPutObjectParams),
|
|
1758
|
-
options=make_request_options(
|
|
1759
|
-
extra_headers=extra_headers,
|
|
1760
|
-
extra_query=extra_query,
|
|
1761
|
-
extra_body=extra_body,
|
|
1762
|
-
timeout=timeout,
|
|
1763
|
-
query=await async_maybe_transform(
|
|
1764
|
-
{
|
|
1765
|
-
"part_number": part_number,
|
|
1766
|
-
"upload_id": upload_id,
|
|
1767
|
-
},
|
|
1768
|
-
client_put_object_params.ClientPutObjectParams,
|
|
1769
|
-
),
|
|
1770
|
-
),
|
|
1771
|
-
cast_to=NoneType,
|
|
1772
|
-
)
|
|
1773
|
-
|
|
1774
1147
|
@override
|
|
1775
1148
|
def _make_status_error(
|
|
1776
1149
|
self,
|
|
@@ -2087,32 +1460,6 @@ class TelnyxWithRawResponse:
|
|
|
2087
1460
|
self.partner_campaigns = partner_campaigns.PartnerCampaignsResourceWithRawResponse(client.partner_campaigns)
|
|
2088
1461
|
self.well_known = well_known.WellKnownResourceWithRawResponse(client.well_known)
|
|
2089
1462
|
|
|
2090
|
-
self.create_bucket = to_raw_response_wrapper(
|
|
2091
|
-
client.create_bucket,
|
|
2092
|
-
)
|
|
2093
|
-
self.delete_bucket = to_raw_response_wrapper(
|
|
2094
|
-
client.delete_bucket,
|
|
2095
|
-
)
|
|
2096
|
-
self.delete_object = to_raw_response_wrapper(
|
|
2097
|
-
client.delete_object,
|
|
2098
|
-
)
|
|
2099
|
-
self.delete_objects = to_raw_response_wrapper(
|
|
2100
|
-
client.delete_objects,
|
|
2101
|
-
)
|
|
2102
|
-
self.get_object = to_custom_raw_response_wrapper(
|
|
2103
|
-
client.get_object,
|
|
2104
|
-
BinaryAPIResponse,
|
|
2105
|
-
)
|
|
2106
|
-
self.list_buckets = to_raw_response_wrapper(
|
|
2107
|
-
client.list_buckets,
|
|
2108
|
-
)
|
|
2109
|
-
self.list_objects = to_raw_response_wrapper(
|
|
2110
|
-
client.list_objects,
|
|
2111
|
-
)
|
|
2112
|
-
self.put_object = to_raw_response_wrapper(
|
|
2113
|
-
client.put_object,
|
|
2114
|
-
)
|
|
2115
|
-
|
|
2116
1463
|
|
|
2117
1464
|
class AsyncTelnyxWithRawResponse:
|
|
2118
1465
|
def __init__(self, client: AsyncTelnyx) -> None:
|
|
@@ -2436,32 +1783,6 @@ class AsyncTelnyxWithRawResponse:
|
|
|
2436
1783
|
)
|
|
2437
1784
|
self.well_known = well_known.AsyncWellKnownResourceWithRawResponse(client.well_known)
|
|
2438
1785
|
|
|
2439
|
-
self.create_bucket = async_to_raw_response_wrapper(
|
|
2440
|
-
client.create_bucket,
|
|
2441
|
-
)
|
|
2442
|
-
self.delete_bucket = async_to_raw_response_wrapper(
|
|
2443
|
-
client.delete_bucket,
|
|
2444
|
-
)
|
|
2445
|
-
self.delete_object = async_to_raw_response_wrapper(
|
|
2446
|
-
client.delete_object,
|
|
2447
|
-
)
|
|
2448
|
-
self.delete_objects = async_to_raw_response_wrapper(
|
|
2449
|
-
client.delete_objects,
|
|
2450
|
-
)
|
|
2451
|
-
self.get_object = async_to_custom_raw_response_wrapper(
|
|
2452
|
-
client.get_object,
|
|
2453
|
-
AsyncBinaryAPIResponse,
|
|
2454
|
-
)
|
|
2455
|
-
self.list_buckets = async_to_raw_response_wrapper(
|
|
2456
|
-
client.list_buckets,
|
|
2457
|
-
)
|
|
2458
|
-
self.list_objects = async_to_raw_response_wrapper(
|
|
2459
|
-
client.list_objects,
|
|
2460
|
-
)
|
|
2461
|
-
self.put_object = async_to_raw_response_wrapper(
|
|
2462
|
-
client.put_object,
|
|
2463
|
-
)
|
|
2464
|
-
|
|
2465
1786
|
|
|
2466
1787
|
class TelnyxWithStreamedResponse:
|
|
2467
1788
|
def __init__(self, client: Telnyx) -> None:
|
|
@@ -2791,32 +2112,6 @@ class TelnyxWithStreamedResponse:
|
|
|
2791
2112
|
)
|
|
2792
2113
|
self.well_known = well_known.WellKnownResourceWithStreamingResponse(client.well_known)
|
|
2793
2114
|
|
|
2794
|
-
self.create_bucket = to_streamed_response_wrapper(
|
|
2795
|
-
client.create_bucket,
|
|
2796
|
-
)
|
|
2797
|
-
self.delete_bucket = to_streamed_response_wrapper(
|
|
2798
|
-
client.delete_bucket,
|
|
2799
|
-
)
|
|
2800
|
-
self.delete_object = to_streamed_response_wrapper(
|
|
2801
|
-
client.delete_object,
|
|
2802
|
-
)
|
|
2803
|
-
self.delete_objects = to_streamed_response_wrapper(
|
|
2804
|
-
client.delete_objects,
|
|
2805
|
-
)
|
|
2806
|
-
self.get_object = to_custom_streamed_response_wrapper(
|
|
2807
|
-
client.get_object,
|
|
2808
|
-
StreamedBinaryAPIResponse,
|
|
2809
|
-
)
|
|
2810
|
-
self.list_buckets = to_streamed_response_wrapper(
|
|
2811
|
-
client.list_buckets,
|
|
2812
|
-
)
|
|
2813
|
-
self.list_objects = to_streamed_response_wrapper(
|
|
2814
|
-
client.list_objects,
|
|
2815
|
-
)
|
|
2816
|
-
self.put_object = to_streamed_response_wrapper(
|
|
2817
|
-
client.put_object,
|
|
2818
|
-
)
|
|
2819
|
-
|
|
2820
2115
|
|
|
2821
2116
|
class AsyncTelnyxWithStreamedResponse:
|
|
2822
2117
|
def __init__(self, client: AsyncTelnyx) -> None:
|
|
@@ -3188,32 +2483,6 @@ class AsyncTelnyxWithStreamedResponse:
|
|
|
3188
2483
|
)
|
|
3189
2484
|
self.well_known = well_known.AsyncWellKnownResourceWithStreamingResponse(client.well_known)
|
|
3190
2485
|
|
|
3191
|
-
self.create_bucket = async_to_streamed_response_wrapper(
|
|
3192
|
-
client.create_bucket,
|
|
3193
|
-
)
|
|
3194
|
-
self.delete_bucket = async_to_streamed_response_wrapper(
|
|
3195
|
-
client.delete_bucket,
|
|
3196
|
-
)
|
|
3197
|
-
self.delete_object = async_to_streamed_response_wrapper(
|
|
3198
|
-
client.delete_object,
|
|
3199
|
-
)
|
|
3200
|
-
self.delete_objects = async_to_streamed_response_wrapper(
|
|
3201
|
-
client.delete_objects,
|
|
3202
|
-
)
|
|
3203
|
-
self.get_object = async_to_custom_streamed_response_wrapper(
|
|
3204
|
-
client.get_object,
|
|
3205
|
-
AsyncStreamedBinaryAPIResponse,
|
|
3206
|
-
)
|
|
3207
|
-
self.list_buckets = async_to_streamed_response_wrapper(
|
|
3208
|
-
client.list_buckets,
|
|
3209
|
-
)
|
|
3210
|
-
self.list_objects = async_to_streamed_response_wrapper(
|
|
3211
|
-
client.list_objects,
|
|
3212
|
-
)
|
|
3213
|
-
self.put_object = async_to_streamed_response_wrapper(
|
|
3214
|
-
client.put_object,
|
|
3215
|
-
)
|
|
3216
|
-
|
|
3217
2486
|
|
|
3218
2487
|
Client = Telnyx
|
|
3219
2488
|
|