telnyx 3.3.0a0__py3-none-any.whl → 3.4.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 +3 -1
- telnyx/_base_client.py +12 -12
- telnyx/_client.py +63 -762
- telnyx/_compat.py +48 -48
- telnyx/_models.py +50 -44
- telnyx/_qs.py +7 -7
- telnyx/_types.py +53 -12
- telnyx/_utils/__init__.py +9 -2
- telnyx/_utils/_compat.py +45 -0
- telnyx/_utils/_datetime_parse.py +136 -0
- telnyx/_utils/_transform.py +13 -3
- telnyx/_utils/_typing.py +6 -1
- telnyx/_utils/_utils.py +4 -5
- telnyx/_version.py +1 -1
- telnyx/resources/__init__.py +70 -0
- telnyx/resources/access_ip_address.py +15 -15
- telnyx/resources/access_ip_ranges.py +13 -13
- telnyx/resources/actions/purchase.py +13 -14
- telnyx/resources/actions/register.py +11 -12
- telnyx/resources/addresses/actions.py +13 -13
- telnyx/resources/addresses/addresses.py +33 -35
- telnyx/resources/advanced_orders.py +102 -106
- telnyx/resources/ai/ai.py +7 -7
- telnyx/resources/ai/assistants/assistants.py +89 -89
- telnyx/resources/ai/assistants/canary_deploys.py +9 -9
- telnyx/resources/ai/assistants/scheduled_events.py +21 -21
- telnyx/resources/ai/assistants/tests/runs.py +13 -13
- telnyx/resources/ai/assistants/tests/test_suites/runs.py +13 -13
- telnyx/resources/ai/assistants/tests/test_suites/test_suites.py +3 -3
- telnyx/resources/ai/assistants/tests/tests.py +43 -43
- telnyx/resources/ai/assistants/tools.py +7 -7
- telnyx/resources/ai/assistants/versions.py +45 -45
- telnyx/resources/ai/audio.py +11 -11
- telnyx/resources/ai/chat.py +48 -48
- telnyx/resources/ai/clusters.py +27 -29
- telnyx/resources/ai/conversations/conversations.py +179 -45
- telnyx/resources/ai/conversations/insight_groups/insight_groups.py +23 -23
- telnyx/resources/ai/conversations/insight_groups/insights.py +5 -5
- telnyx/resources/ai/conversations/insights.py +25 -25
- telnyx/resources/ai/conversations/messages.py +3 -136
- telnyx/resources/ai/embeddings/buckets.py +7 -7
- telnyx/resources/ai/embeddings/embeddings.py +23 -24
- telnyx/resources/ai/fine_tuning/jobs.py +13 -13
- telnyx/resources/audit_events.py +9 -9
- telnyx/resources/authentication_providers.py +29 -29
- telnyx/resources/available_phone_number_blocks.py +5 -5
- telnyx/resources/available_phone_numbers.py +5 -5
- telnyx/resources/balance.py +3 -3
- telnyx/resources/billing_groups.py +17 -17
- telnyx/resources/brand/brand.py +121 -117
- telnyx/resources/brand/external_vetting.py +9 -9
- telnyx/resources/bulk_sim_card_actions.py +11 -11
- telnyx/resources/bundle_pricing/billing_bundles.py +13 -13
- telnyx/resources/bundle_pricing/user_bundles.py +35 -35
- telnyx/resources/call_control_applications.py +64 -68
- telnyx/resources/call_events.py +7 -7
- telnyx/resources/calls/actions.py +699 -699
- telnyx/resources/calls/calls.py +116 -110
- telnyx/resources/campaign/campaign.py +47 -47
- telnyx/resources/campaign/osr.py +3 -3
- telnyx/resources/campaign/usecase.py +3 -3
- telnyx/resources/campaign_builder/brand.py +3 -3
- telnyx/resources/campaign_builder/campaign_builder.py +68 -68
- telnyx/resources/channel_zones.py +7 -7
- telnyx/resources/charges_breakdown.py +7 -7
- telnyx/resources/charges_summary.py +3 -3
- telnyx/resources/comments.py +17 -17
- telnyx/resources/conferences/actions.py +123 -140
- telnyx/resources/conferences/conferences.py +37 -41
- telnyx/resources/connections.py +15 -15
- telnyx/resources/country_coverage.py +5 -5
- telnyx/resources/credential_connections/actions.py +3 -3
- telnyx/resources/credential_connections/credential_connections.py +96 -96
- telnyx/resources/custom_storage_credentials.py +9 -9
- telnyx/resources/customer_service_records.py +21 -23
- telnyx/resources/detail_records.py +9 -11
- telnyx/resources/dialogflow_connections.py +25 -25
- telnyx/resources/document_links.py +7 -7
- telnyx/resources/documents.py +45 -45
- telnyx/resources/dynamic_emergency_addresses.py +23 -23
- telnyx/resources/dynamic_emergency_endpoints.py +13 -13
- telnyx/resources/enum.py +3 -3
- telnyx/resources/external_connections/civic_addresses.py +7 -7
- telnyx/resources/external_connections/external_connections.py +42 -42
- telnyx/resources/external_connections/log_messages.py +11 -11
- telnyx/resources/external_connections/phone_numbers.py +13 -13
- telnyx/resources/external_connections/releases.py +9 -9
- telnyx/resources/external_connections/uploads.py +27 -29
- telnyx/resources/fax_applications.py +48 -48
- telnyx/resources/faxes/actions.py +5 -5
- telnyx/resources/faxes/faxes.py +35 -35
- telnyx/resources/fqdn_connections.py +94 -94
- telnyx/resources/fqdns.py +25 -25
- telnyx/resources/global_ip_allowed_ports.py +3 -3
- telnyx/resources/global_ip_assignment_health.py +5 -5
- telnyx/resources/global_ip_assignments.py +19 -19
- telnyx/resources/global_ip_assignments_usage.py +5 -5
- telnyx/resources/global_ip_health_check_types.py +3 -3
- telnyx/resources/global_ip_health_checks.py +17 -17
- telnyx/resources/global_ip_latency.py +5 -5
- telnyx/resources/global_ip_protocols.py +3 -3
- telnyx/resources/global_ip_usage.py +5 -5
- telnyx/resources/global_ips.py +17 -17
- telnyx/resources/inbound_channels.py +5 -5
- telnyx/resources/integration_secrets.py +17 -17
- telnyx/resources/inventory_coverage.py +5 -5
- telnyx/resources/invoices.py +11 -11
- telnyx/resources/ip_connections.py +94 -94
- telnyx/resources/ips.py +23 -23
- telnyx/resources/ledger_billing_group_reports.py +9 -9
- 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 +482 -0
- telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
- telnyx/resources/legacy/reporting/batch_detail_records/voice.py +539 -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/list.py +5 -5
- telnyx/resources/managed_accounts/actions.py +7 -7
- telnyx/resources/managed_accounts/managed_accounts.py +33 -33
- telnyx/resources/media.py +23 -23
- telnyx/resources/messages/messages.py +124 -124
- telnyx/resources/messages/rcs.py +7 -7
- telnyx/resources/messaging/rcs/agents.py +15 -15
- telnyx/resources/messaging/rcs/rcs.py +9 -11
- telnyx/resources/messaging_hosted_number_orders/actions.py +7 -7
- telnyx/resources/messaging_hosted_number_orders/messaging_hosted_number_orders.py +26 -26
- telnyx/resources/messaging_hosted_numbers.py +3 -3
- telnyx/resources/messaging_numbers_bulk_updates.py +7 -9
- telnyx/resources/messaging_optouts.py +11 -11
- telnyx/resources/messaging_profiles/autoresp_configs.py +25 -26
- telnyx/resources/messaging_profiles/messaging_profiles.py +92 -76
- telnyx/resources/messaging_tollfree/verification/requests.py +27 -27
- telnyx/resources/messaging_url_domains.py +5 -5
- telnyx/resources/messsages.py +11 -11
- telnyx/resources/mobile_network_operators.py +7 -7
- telnyx/resources/mobile_push_credentials.py +23 -23
- telnyx/resources/network_coverage.py +9 -9
- telnyx/resources/networks/default_gateway.py +9 -9
- telnyx/resources/networks/networks.py +21 -21
- telnyx/resources/notification_channels.py +27 -27
- telnyx/resources/notification_event_conditions.py +7 -7
- telnyx/resources/notification_events.py +5 -5
- telnyx/resources/notification_profiles.py +17 -17
- telnyx/resources/notification_settings.py +21 -21
- telnyx/resources/number_block_orders.py +17 -17
- telnyx/resources/number_lookup.py +5 -5
- telnyx/resources/number_order_phone_numbers.py +13 -13
- telnyx/resources/number_orders.py +27 -27
- telnyx/resources/number_reservations/actions.py +3 -3
- telnyx/resources/number_reservations/number_reservations.py +15 -15
- telnyx/resources/numbers_features.py +5 -7
- telnyx/resources/oauth.py +855 -0
- telnyx/resources/oauth_clients.py +711 -0
- telnyx/resources/oauth_grants.py +349 -0
- telnyx/resources/operator_connect/actions.py +3 -3
- telnyx/resources/ota_updates.py +9 -9
- telnyx/resources/outbound_voice_profiles.py +66 -66
- telnyx/resources/partner_campaigns.py +25 -25
- telnyx/resources/payment/auto_recharge_prefs.py +15 -15
- telnyx/resources/phone_number_assignment_by_profile.py +15 -15
- telnyx/resources/phone_number_blocks/jobs.py +13 -13
- telnyx/resources/phone_number_campaigns.py +19 -19
- telnyx/resources/phone_numbers/actions.py +9 -11
- telnyx/resources/phone_numbers/csv_downloads.py +13 -13
- telnyx/resources/phone_numbers/jobs.py +54 -42
- telnyx/resources/phone_numbers/messaging.py +13 -13
- telnyx/resources/phone_numbers/phone_numbers.py +39 -40
- telnyx/resources/phone_numbers/voice.py +31 -31
- telnyx/resources/phone_numbers/voicemail.py +15 -15
- telnyx/resources/phone_numbers_regulatory_requirements.py +5 -5
- telnyx/resources/portability_checks.py +5 -7
- telnyx/resources/porting/events.py +11 -11
- telnyx/resources/porting/loa_configurations.py +17 -17
- telnyx/resources/porting/porting.py +3 -3
- telnyx/resources/porting/reports.py +11 -11
- telnyx/resources/porting_orders/action_requirements.py +11 -11
- telnyx/resources/porting_orders/actions.py +13 -13
- telnyx/resources/porting_orders/activation_jobs.py +11 -11
- telnyx/resources/porting_orders/additional_documents.py +15 -15
- telnyx/resources/porting_orders/associated_phone_numbers.py +13 -13
- telnyx/resources/porting_orders/comments.py +9 -9
- telnyx/resources/porting_orders/phone_number_blocks.py +13 -13
- telnyx/resources/porting_orders/phone_number_configurations.py +13 -13
- telnyx/resources/porting_orders/phone_number_extensions.py +13 -13
- telnyx/resources/porting_orders/porting_orders.py +82 -70
- telnyx/resources/porting_orders/verification_codes.py +20 -20
- telnyx/resources/porting_phone_numbers.py +7 -7
- telnyx/resources/portouts/comments.py +7 -7
- telnyx/resources/portouts/events.py +11 -11
- telnyx/resources/portouts/portouts.py +17 -17
- telnyx/resources/portouts/reports.py +11 -11
- telnyx/resources/portouts/supporting_documents.py +7 -7
- telnyx/resources/private_wireless_gateways.py +25 -25
- telnyx/resources/public_internet_gateways.py +19 -19
- telnyx/resources/queues/calls.py +7 -7
- telnyx/resources/queues/queues.py +3 -3
- telnyx/resources/recording_transcriptions.py +7 -7
- telnyx/resources/recordings/actions.py +5 -7
- telnyx/resources/recordings/recordings.py +11 -11
- telnyx/resources/regions.py +3 -3
- telnyx/resources/regulatory_requirements.py +5 -5
- telnyx/resources/reports/cdr_usage_reports.py +9 -9
- telnyx/resources/reports/mdr_usage_reports.py +22 -22
- telnyx/resources/reports/reports.py +47 -48
- telnyx/resources/requirement_groups.py +23 -23
- telnyx/resources/requirement_types.py +9 -11
- telnyx/resources/requirements.py +11 -11
- telnyx/resources/room_compositions.py +27 -27
- telnyx/resources/room_participants.py +9 -9
- telnyx/resources/room_recordings.py +17 -17
- telnyx/resources/rooms/actions.py +11 -11
- telnyx/resources/rooms/rooms.py +43 -43
- telnyx/resources/rooms/sessions/actions.py +22 -22
- telnyx/resources/rooms/sessions/sessions.py +27 -27
- telnyx/resources/seti.py +5 -5
- telnyx/resources/short_codes.py +11 -11
- telnyx/resources/sim_card_data_usage_notifications.py +21 -21
- telnyx/resources/sim_card_groups/actions.py +23 -23
- telnyx/resources/sim_card_groups/sim_card_groups.py +29 -29
- telnyx/resources/sim_card_order_preview.py +3 -3
- telnyx/resources/sim_card_orders.py +11 -11
- telnyx/resources/sim_cards/actions.py +29 -31
- telnyx/resources/sim_cards/sim_cards.py +48 -48
- telnyx/resources/siprec_connectors.py +13 -13
- telnyx/resources/storage/buckets/buckets.py +5 -5
- telnyx/resources/storage/buckets/ssl_certificate.py +11 -11
- telnyx/resources/storage/buckets/usage.py +5 -5
- telnyx/resources/storage/migration_sources.py +11 -11
- telnyx/resources/storage/migrations/actions.py +3 -3
- telnyx/resources/storage/migrations/migrations.py +9 -9
- telnyx/resources/storage/storage.py +3 -3
- telnyx/resources/sub_number_orders.py +17 -17
- telnyx/resources/sub_number_orders_report.py +19 -19
- telnyx/resources/telephony_credentials.py +31 -31
- telnyx/resources/texml/accounts/accounts.py +15 -15
- telnyx/resources/texml/accounts/calls/calls.py +156 -145
- telnyx/resources/texml/accounts/calls/recordings.py +5 -5
- telnyx/resources/texml/accounts/calls/recordings_json.py +19 -19
- telnyx/resources/texml/accounts/calls/siprec.py +5 -5
- telnyx/resources/texml/accounts/calls/streams.py +5 -5
- telnyx/resources/texml/accounts/conferences/conferences.py +31 -31
- telnyx/resources/texml/accounts/conferences/participants.py +134 -123
- telnyx/resources/texml/accounts/recordings/json.py +5 -5
- telnyx/resources/texml/accounts/transcriptions/json.py +5 -5
- telnyx/resources/texml/calls.py +79 -79
- telnyx/resources/texml/texml.py +3 -3
- telnyx/resources/texml_applications.py +65 -66
- telnyx/resources/text_to_speech.py +9 -9
- telnyx/resources/usage_reports.py +31 -32
- telnyx/resources/user_addresses.py +29 -31
- telnyx/resources/user_tags.py +5 -5
- telnyx/resources/verifications/actions.py +7 -7
- telnyx/resources/verifications/by_phone_number/actions.py +3 -3
- telnyx/resources/verifications/by_phone_number/by_phone_number.py +3 -3
- telnyx/resources/verifications/verifications.py +29 -19
- telnyx/resources/verified_numbers/actions.py +3 -3
- telnyx/resources/verified_numbers/verified_numbers.py +36 -15
- telnyx/resources/verify_profiles.py +226 -44
- telnyx/resources/virtual_cross_connects.py +45 -45
- telnyx/resources/virtual_cross_connects_coverage.py +9 -9
- telnyx/resources/webhook_deliveries.py +9 -9
- telnyx/resources/well_known.py +198 -0
- telnyx/resources/wireguard_interfaces.py +17 -17
- telnyx/resources/wireguard_peers.py +21 -21
- telnyx/resources/wireless/detail_records_reports.py +17 -17
- telnyx/resources/wireless/wireless.py +3 -3
- telnyx/resources/wireless_blocklist_values.py +3 -3
- telnyx/resources/wireless_blocklists.py +29 -30
- telnyx/types/__init__.py +53 -13
- telnyx/types/actions/purchase_create_params.py +3 -2
- telnyx/types/actions/register_create_params.py +4 -3
- telnyx/types/addresses/action_validate_response.py +8 -3
- telnyx/types/{advanced_order_update_params.py → advanced_order_update_requirement_group_params.py} +2 -2
- telnyx/types/ai/__init__.py +1 -0
- telnyx/types/ai/chat_create_completion_params.py +3 -2
- telnyx/types/ai/cluster_compute_params.py +3 -2
- telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +6 -5
- telnyx/types/ai/conversations/__init__.py +0 -1
- telnyx/types/ai/embedding_list_params.py +3 -2
- telnyx/types/ai/inference_embedding_bucket_ids_param.py +3 -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/inference_embedding_webhook_tool_params.py +2 -0
- telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +8 -4
- 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/bundle_pricing/billing_bundle_list_params.py +4 -3
- telnyx/types/bundle_pricing/user_bundle_list_params.py +4 -3
- telnyx/types/bundle_pricing/user_bundle_list_unused_params.py +4 -3
- telnyx/types/call_control_application_update_params.py +3 -2
- telnyx/types/call_dial_params.py +14 -6
- 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_start_transcription_params.py +260 -6
- telnyx/types/calls/action_transfer_params.py +50 -0
- telnyx/types/calls/transcription_engine_a_config_param.py +4 -3
- telnyx/types/calls/transcription_start_request_param.py +261 -6
- telnyx/types/campaign_builder_create_params.py +4 -3
- telnyx/types/campaign_submit_appeal_response.py +0 -3
- telnyx/types/conferences/action_hold_params.py +3 -2
- telnyx/types/conferences/action_join_params.py +3 -2
- telnyx/types/conferences/action_mute_params.py +3 -2
- telnyx/types/conferences/action_play_params.py +2 -2
- telnyx/types/conferences/action_speak_params.py +3 -2
- telnyx/types/conferences/action_stop_params.py +3 -2
- telnyx/types/conferences/action_unhold_params.py +3 -2
- telnyx/types/conferences/action_unmute_params.py +3 -2
- telnyx/types/conferences/action_update_params.py +3 -2
- telnyx/types/country_coverage_retrieve_country_response.py +7 -0
- telnyx/types/country_coverage_retrieve_response.py +7 -0
- telnyx/types/credential_connection_create_params.py +3 -2
- telnyx/types/credential_connection_update_params.py +3 -2
- telnyx/types/credential_inbound_param.py +3 -2
- telnyx/types/customer_service_record_list_params.py +2 -1
- telnyx/types/customer_service_record_verify_phone_number_coverage_params.py +3 -2
- telnyx/types/detail_record_list_params.py +4 -2
- telnyx/types/document_list_params.py +2 -1
- telnyx/types/external_connection_create_params.py +4 -2
- telnyx/types/external_connection_update_params.py +4 -2
- telnyx/types/external_connections/civic_address_list_params.py +3 -2
- telnyx/types/external_connections/upload_create_params.py +3 -1
- telnyx/types/fax_application_create_params.py +3 -2
- telnyx/types/fax_application_update_params.py +3 -2
- telnyx/types/fqdn_connection_create_params.py +3 -2
- telnyx/types/fqdn_connection_update_params.py +3 -2
- telnyx/types/global_ip_latency_retrieve_response.py +7 -7
- telnyx/types/inbound_fqdn_param.py +4 -2
- telnyx/types/inbound_ip_param.py +3 -2
- telnyx/types/ip_connection_create_params.py +4 -3
- telnyx/types/ip_connection_update_params.py +3 -2
- telnyx/types/legacy/__init__.py +3 -0
- telnyx/types/legacy/reporting/__init__.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +23 -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 +55 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +24 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +12 -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 +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +12 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +12 -0
- 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 +57 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +13 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +13 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +24 -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 +13 -0
- telnyx/types/legacy/reporting/filter.py +31 -0
- telnyx/types/legacy/reporting/filter_param.py +30 -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 +20 -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_params.py +29 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +13 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +13 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +24 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +13 -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 +13 -0
- telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +13 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +24 -0
- telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +13 -0
- telnyx/types/media_list_params.py +3 -2
- telnyx/types/message_schedule_params.py +3 -2
- telnyx/types/message_send_group_mms_params.py +3 -3
- telnyx/types/message_send_long_code_params.py +2 -2
- telnyx/types/message_send_number_pool_params.py +3 -2
- telnyx/types/message_send_params.py +3 -2
- telnyx/types/message_send_short_code_params.py +2 -2
- telnyx/types/messaging/rc_list_bulk_capabilities_params.py +3 -2
- telnyx/types/messaging_hosted_number_order_check_eligibility_params.py +3 -2
- telnyx/types/messaging_hosted_number_order_create_params.py +3 -2
- telnyx/types/messaging_hosted_number_order_create_verification_codes_params.py +3 -2
- telnyx/types/messaging_numbers_bulk_update_create_params.py +3 -2
- telnyx/types/messaging_profile.py +3 -0
- telnyx/types/messaging_profile_create_params.py +6 -2
- telnyx/types/messaging_profile_update_params.py +6 -2
- telnyx/types/messaging_profiles/autoresp_config_create_params.py +3 -2
- telnyx/types/messaging_profiles/autoresp_config_update_params.py +3 -2
- telnyx/types/messsage_rcs_params.py +2 -2
- telnyx/types/number_order_status_update_webhook_event.py +30 -4
- telnyx/types/numbers_feature_create_params.py +3 -2
- telnyx/types/oauth_client.py +59 -0
- telnyx/types/oauth_client_create_params.py +39 -0
- telnyx/types/oauth_client_create_response.py +12 -0
- telnyx/types/oauth_client_list_params.py +38 -0
- telnyx/types/oauth_client_list_response.py +28 -0
- telnyx/types/oauth_client_retrieve_response.py +12 -0
- telnyx/types/oauth_client_update_params.py +36 -0
- telnyx/types/oauth_client_update_response.py +12 -0
- telnyx/types/oauth_grant.py +29 -0
- telnyx/types/oauth_grant_delete_response.py +12 -0
- telnyx/types/oauth_grant_list_params.py +17 -0
- telnyx/types/oauth_grant_list_response.py +28 -0
- telnyx/types/oauth_grant_retrieve_response.py +12 -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/outbound_call_recording_param.py +3 -2
- telnyx/types/outbound_voice_profile_create_params.py +4 -3
- telnyx/types/outbound_voice_profile_update_params.py +4 -3
- telnyx/types/phone_number_delete_response.py +7 -0
- telnyx/types/phone_number_detailed.py +7 -0
- telnyx/types/phone_number_list_params.py +9 -2
- telnyx/types/phone_number_slim_list_params.py +3 -2
- telnyx/types/phone_number_update_params.py +3 -2
- telnyx/types/phone_numbers/action_verify_ownership_params.py +3 -2
- telnyx/types/phone_numbers/job_delete_batch_params.py +3 -2
- telnyx/types/phone_numbers/job_update_batch_params.py +10 -3
- telnyx/types/phone_numbers/job_update_emergency_settings_batch_params.py +4 -2
- telnyx/types/portability_check_run_params.py +3 -2
- telnyx/types/porting/export_porting_orders_csv_report_param.py +2 -1
- telnyx/types/porting_order.py +3 -0
- telnyx/types/porting_order_create_params.py +6 -2
- telnyx/types/porting_order_list_params.py +52 -31
- telnyx/types/porting_order_phone_number_configuration_param.py +3 -2
- telnyx/types/porting_order_update_params.py +2 -0
- telnyx/types/porting_orders/action_requirement_list_params.py +3 -2
- telnyx/types/porting_orders/phone_number_block_list_params.py +5 -3
- telnyx/types/porting_orders/phone_number_configuration_list_params.py +22 -21
- telnyx/types/porting_orders/verification_code_send_params.py +3 -2
- telnyx/types/portout_list_params.py +2 -1
- telnyx/types/portouts/export_portouts_csv_report_param.py +3 -2
- telnyx/types/recordings/action_delete_params.py +3 -2
- telnyx/types/report_list_wdrs_params.py +3 -2
- telnyx/types/reports/mdr_usage_report_fetch_sync_params.py +3 -2
- telnyx/types/rooms/sessions/action_kick_params.py +5 -3
- telnyx/types/rooms/sessions/action_mute_params.py +5 -3
- telnyx/types/rooms/sessions/action_unmute_params.py +5 -3
- telnyx/types/shared/__init__.py +1 -0
- telnyx/types/{error.py → shared/api_error.py} +3 -3
- telnyx/types/shared/simple_sim_card.py +15 -0
- telnyx/types/sim_card.py +12 -0
- telnyx/types/sim_card_list_params.py +2 -1
- telnyx/types/sim_card_update_params.py +4 -3
- telnyx/types/sim_cards/action_bulk_set_public_ips_params.py +3 -2
- telnyx/types/sim_cards/action_validate_registration_codes_params.py +3 -2
- telnyx/types/stream_bidirectional_codec.py +1 -1
- telnyx/types/stream_codec.py +1 -1
- telnyx/types/texml/accounts/call_calls_params.py +16 -1
- telnyx/types/texml/accounts/conferences/participant_participants_params.py +16 -1
- telnyx/types/texml_application_create_params.py +2 -2
- telnyx/types/texml_application_update_params.py +2 -2
- telnyx/types/usage_report_list_params.py +5 -4
- telnyx/types/verification_trigger_call_params.py +7 -0
- telnyx/types/verified_number_create_params.py +10 -0
- telnyx/types/verify_profile.py +18 -3
- telnyx/types/verify_profile_create_params.py +6 -4
- telnyx/types/verify_profile_create_template_params.py +12 -0
- telnyx/types/verify_profile_create_template_response.py +12 -0
- telnyx/types/verify_profile_message_template_response.py +13 -0
- telnyx/types/verify_profile_retrieve_templates_response.py +4 -9
- telnyx/types/verify_profile_update_params.py +6 -4
- telnyx/types/verify_profile_update_template_params.py +12 -0
- telnyx/types/verify_profile_update_template_response.py +12 -0
- telnyx/types/video_region_param.py +4 -2
- 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/types/wireless_blocklist_create_params.py +3 -2
- telnyx/types/wireless_blocklist_update_params.py +3 -2
- {telnyx-3.3.0a0.dist-info → telnyx-3.4.0.dist-info}/METADATA +60 -19
- {telnyx-3.3.0a0.dist-info → telnyx-3.4.0.dist-info}/RECORD +494 -407
- 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-3.3.0a0.dist-info → telnyx-3.4.0.dist-info}/WHEEL +0 -0
- {telnyx-3.3.0a0.dist-info → telnyx-3.4.0.dist-info}/licenses/LICENSE +0 -0
telnyx/_client.py
CHANGED
|
@@ -3,55 +3,24 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any,
|
|
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
|
-
NOT_GIVEN,
|
|
22
|
-
Body,
|
|
23
14
|
Omit,
|
|
24
|
-
Query,
|
|
25
|
-
Headers,
|
|
26
15
|
Timeout,
|
|
27
|
-
NoneType,
|
|
28
16
|
NotGiven,
|
|
29
|
-
FileTypes,
|
|
30
17
|
Transport,
|
|
31
18
|
ProxiesTypes,
|
|
32
19
|
RequestOptions,
|
|
20
|
+
not_given,
|
|
33
21
|
)
|
|
34
|
-
from ._utils import
|
|
35
|
-
is_given,
|
|
36
|
-
maybe_transform,
|
|
37
|
-
get_async_library,
|
|
38
|
-
async_maybe_transform,
|
|
39
|
-
)
|
|
22
|
+
from ._utils import is_given, get_async_library
|
|
40
23
|
from ._version import __version__
|
|
41
|
-
from ._response import (
|
|
42
|
-
BinaryAPIResponse,
|
|
43
|
-
AsyncBinaryAPIResponse,
|
|
44
|
-
StreamedBinaryAPIResponse,
|
|
45
|
-
AsyncStreamedBinaryAPIResponse,
|
|
46
|
-
to_raw_response_wrapper,
|
|
47
|
-
to_streamed_response_wrapper,
|
|
48
|
-
async_to_raw_response_wrapper,
|
|
49
|
-
to_custom_raw_response_wrapper,
|
|
50
|
-
async_to_streamed_response_wrapper,
|
|
51
|
-
to_custom_streamed_response_wrapper,
|
|
52
|
-
async_to_custom_raw_response_wrapper,
|
|
53
|
-
async_to_custom_streamed_response_wrapper,
|
|
54
|
-
)
|
|
55
24
|
from .resources import (
|
|
56
25
|
ips,
|
|
57
26
|
enum,
|
|
@@ -59,6 +28,7 @@ from .resources import (
|
|
|
59
28
|
seti,
|
|
60
29
|
fqdns,
|
|
61
30
|
media,
|
|
31
|
+
oauth,
|
|
62
32
|
balance,
|
|
63
33
|
regions,
|
|
64
34
|
comments,
|
|
@@ -68,15 +38,18 @@ from .resources import (
|
|
|
68
38
|
messsages,
|
|
69
39
|
user_tags,
|
|
70
40
|
global_ips,
|
|
41
|
+
well_known,
|
|
71
42
|
call_events,
|
|
72
43
|
connections,
|
|
73
44
|
ota_updates,
|
|
74
45
|
short_codes,
|
|
75
46
|
audit_events,
|
|
47
|
+
oauth_grants,
|
|
76
48
|
requirements,
|
|
77
49
|
channel_zones,
|
|
78
50
|
number_lookup,
|
|
79
51
|
number_orders,
|
|
52
|
+
oauth_clients,
|
|
80
53
|
usage_reports,
|
|
81
54
|
billing_groups,
|
|
82
55
|
detail_records,
|
|
@@ -169,7 +142,6 @@ from ._base_client import (
|
|
|
169
142
|
DEFAULT_MAX_RETRIES,
|
|
170
143
|
SyncAPIClient,
|
|
171
144
|
AsyncAPIClient,
|
|
172
|
-
make_request_options,
|
|
173
145
|
)
|
|
174
146
|
from .resources.ai import ai
|
|
175
147
|
from .resources.brand import brand
|
|
@@ -177,6 +149,7 @@ from .resources.calls import calls
|
|
|
177
149
|
from .resources.faxes import faxes
|
|
178
150
|
from .resources.rooms import rooms
|
|
179
151
|
from .resources.texml import texml
|
|
152
|
+
from .resources.legacy import legacy
|
|
180
153
|
from .resources.queues import queues
|
|
181
154
|
from .resources.actions import actions
|
|
182
155
|
from .resources.payment import payment
|
|
@@ -202,8 +175,6 @@ from .resources.campaign_builder import campaign_builder
|
|
|
202
175
|
from .resources.managed_accounts import managed_accounts
|
|
203
176
|
from .resources.operator_connect import operator_connect
|
|
204
177
|
from .resources.verified_numbers import verified_numbers
|
|
205
|
-
from .types.list_buckets_response import ListBucketsResponse
|
|
206
|
-
from .types.list_objects_response import ListObjectsResponse
|
|
207
178
|
from .resources.messaging_profiles import messaging_profiles
|
|
208
179
|
from .resources.messaging_tollfree import messaging_tollfree
|
|
209
180
|
from .resources.number_reservations import number_reservations
|
|
@@ -216,6 +187,10 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Telnyx", "
|
|
|
216
187
|
|
|
217
188
|
|
|
218
189
|
class Telnyx(SyncAPIClient):
|
|
190
|
+
legacy: legacy.LegacyResource
|
|
191
|
+
oauth: oauth.OAuthResource
|
|
192
|
+
oauth_clients: oauth_clients.OAuthClientsResource
|
|
193
|
+
oauth_grants: oauth_grants.OAuthGrantsResource
|
|
219
194
|
webhooks: webhooks.WebhooksResource
|
|
220
195
|
access_ip_address: access_ip_address.AccessIPAddressResource
|
|
221
196
|
access_ip_ranges: access_ip_ranges.AccessIPRangesResource
|
|
@@ -365,6 +340,7 @@ class Telnyx(SyncAPIClient):
|
|
|
365
340
|
wireless_blocklist_values: wireless_blocklist_values.WirelessBlocklistValuesResource
|
|
366
341
|
wireless_blocklists: wireless_blocklists.WirelessBlocklistsResource
|
|
367
342
|
partner_campaigns: partner_campaigns.PartnerCampaignsResource
|
|
343
|
+
well_known: well_known.WellKnownResource
|
|
368
344
|
with_raw_response: TelnyxWithRawResponse
|
|
369
345
|
with_streaming_response: TelnyxWithStreamedResponse
|
|
370
346
|
|
|
@@ -376,7 +352,7 @@ class Telnyx(SyncAPIClient):
|
|
|
376
352
|
*,
|
|
377
353
|
api_key: str | None = None,
|
|
378
354
|
base_url: str | httpx.URL | None = None,
|
|
379
|
-
timeout:
|
|
355
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
380
356
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
381
357
|
default_headers: Mapping[str, str] | None = None,
|
|
382
358
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -408,6 +384,7 @@ class Telnyx(SyncAPIClient):
|
|
|
408
384
|
|
|
409
385
|
if base_url is None:
|
|
410
386
|
base_url = os.environ.get("TELNYX_BASE_URL")
|
|
387
|
+
self._base_url_overridden = base_url is not None
|
|
411
388
|
if base_url is None:
|
|
412
389
|
base_url = f"https://api.telnyx.com/v2"
|
|
413
390
|
|
|
@@ -422,6 +399,10 @@ class Telnyx(SyncAPIClient):
|
|
|
422
399
|
_strict_response_validation=_strict_response_validation,
|
|
423
400
|
)
|
|
424
401
|
|
|
402
|
+
self.legacy = legacy.LegacyResource(self)
|
|
403
|
+
self.oauth = oauth.OAuthResource(self)
|
|
404
|
+
self.oauth_clients = oauth_clients.OAuthClientsResource(self)
|
|
405
|
+
self.oauth_grants = oauth_grants.OAuthGrantsResource(self)
|
|
425
406
|
self.webhooks = webhooks.WebhooksResource(self)
|
|
426
407
|
self.access_ip_address = access_ip_address.AccessIPAddressResource(self)
|
|
427
408
|
self.access_ip_ranges = access_ip_ranges.AccessIPRangesResource(self)
|
|
@@ -577,6 +558,7 @@ class Telnyx(SyncAPIClient):
|
|
|
577
558
|
self.wireless_blocklist_values = wireless_blocklist_values.WirelessBlocklistValuesResource(self)
|
|
578
559
|
self.wireless_blocklists = wireless_blocklists.WirelessBlocklistsResource(self)
|
|
579
560
|
self.partner_campaigns = partner_campaigns.PartnerCampaignsResource(self)
|
|
561
|
+
self.well_known = well_known.WellKnownResource(self)
|
|
580
562
|
self.with_raw_response = TelnyxWithRawResponse(self)
|
|
581
563
|
self.with_streaming_response = TelnyxWithStreamedResponse(self)
|
|
582
564
|
|
|
@@ -605,9 +587,9 @@ class Telnyx(SyncAPIClient):
|
|
|
605
587
|
*,
|
|
606
588
|
api_key: str | None = None,
|
|
607
589
|
base_url: str | httpx.URL | None = None,
|
|
608
|
-
timeout: float | Timeout | None | NotGiven =
|
|
590
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
609
591
|
http_client: httpx.Client | None = None,
|
|
610
|
-
max_retries: int | NotGiven =
|
|
592
|
+
max_retries: int | NotGiven = not_given,
|
|
611
593
|
default_headers: Mapping[str, str] | None = None,
|
|
612
594
|
set_default_headers: Mapping[str, str] | None = None,
|
|
613
595
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -636,7 +618,7 @@ class Telnyx(SyncAPIClient):
|
|
|
636
618
|
params = set_default_query
|
|
637
619
|
|
|
638
620
|
http_client = http_client or self._client
|
|
639
|
-
|
|
621
|
+
client = self.__class__(
|
|
640
622
|
api_key=api_key or self.api_key,
|
|
641
623
|
base_url=base_url or self.base_url,
|
|
642
624
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
@@ -646,314 +628,13 @@ class Telnyx(SyncAPIClient):
|
|
|
646
628
|
default_query=params,
|
|
647
629
|
**_extra_kwargs,
|
|
648
630
|
)
|
|
631
|
+
client._base_url_overridden = self._base_url_overridden or base_url is not None
|
|
632
|
+
return client
|
|
649
633
|
|
|
650
634
|
# Alias for `copy` for nicer inline usage, e.g.
|
|
651
635
|
# client.with_options(timeout=10).foo.create(...)
|
|
652
636
|
with_options = copy
|
|
653
637
|
|
|
654
|
-
def create_bucket(
|
|
655
|
-
self,
|
|
656
|
-
bucket_name: str,
|
|
657
|
-
*,
|
|
658
|
-
location_constraint: str | NotGiven = NOT_GIVEN,
|
|
659
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
660
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
661
|
-
extra_headers: Headers | None = None,
|
|
662
|
-
extra_query: Query | None = None,
|
|
663
|
-
extra_body: Body | None = None,
|
|
664
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
665
|
-
) -> None:
|
|
666
|
-
"""
|
|
667
|
-
Create a bucket.
|
|
668
|
-
|
|
669
|
-
Args:
|
|
670
|
-
extra_headers: Send extra headers
|
|
671
|
-
|
|
672
|
-
extra_query: Add additional query parameters to the request
|
|
673
|
-
|
|
674
|
-
extra_body: Add additional JSON properties to the request
|
|
675
|
-
|
|
676
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
677
|
-
"""
|
|
678
|
-
if not bucket_name:
|
|
679
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
680
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
681
|
-
return self.put(
|
|
682
|
-
f"/{bucket_name}",
|
|
683
|
-
body=maybe_transform(
|
|
684
|
-
{"location_constraint": location_constraint}, client_create_bucket_params.ClientCreateBucketParams
|
|
685
|
-
),
|
|
686
|
-
options=make_request_options(
|
|
687
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
688
|
-
),
|
|
689
|
-
cast_to=NoneType,
|
|
690
|
-
)
|
|
691
|
-
|
|
692
|
-
def delete_bucket(
|
|
693
|
-
self,
|
|
694
|
-
bucket_name: str,
|
|
695
|
-
*,
|
|
696
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
697
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
698
|
-
extra_headers: Headers | None = None,
|
|
699
|
-
extra_query: Query | None = None,
|
|
700
|
-
extra_body: Body | None = None,
|
|
701
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
702
|
-
) -> None:
|
|
703
|
-
"""Deletes a bucket.
|
|
704
|
-
|
|
705
|
-
The bucket must be empty for it to be deleted.
|
|
706
|
-
|
|
707
|
-
Args:
|
|
708
|
-
extra_headers: Send extra headers
|
|
709
|
-
|
|
710
|
-
extra_query: Add additional query parameters to the request
|
|
711
|
-
|
|
712
|
-
extra_body: Add additional JSON properties to the request
|
|
713
|
-
|
|
714
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
715
|
-
"""
|
|
716
|
-
if not bucket_name:
|
|
717
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
718
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
719
|
-
return self.delete(
|
|
720
|
-
f"/{bucket_name}",
|
|
721
|
-
options=make_request_options(
|
|
722
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
723
|
-
),
|
|
724
|
-
cast_to=NoneType,
|
|
725
|
-
)
|
|
726
|
-
|
|
727
|
-
def delete_object(
|
|
728
|
-
self,
|
|
729
|
-
object_name: str,
|
|
730
|
-
*,
|
|
731
|
-
bucket_name: str,
|
|
732
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
733
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
734
|
-
extra_headers: Headers | None = None,
|
|
735
|
-
extra_query: Query | None = None,
|
|
736
|
-
extra_body: Body | None = None,
|
|
737
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
738
|
-
) -> None:
|
|
739
|
-
"""
|
|
740
|
-
Delete an object from a given bucket.
|
|
741
|
-
|
|
742
|
-
Args:
|
|
743
|
-
extra_headers: Send extra headers
|
|
744
|
-
|
|
745
|
-
extra_query: Add additional query parameters to the request
|
|
746
|
-
|
|
747
|
-
extra_body: Add additional JSON properties to the request
|
|
748
|
-
|
|
749
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
750
|
-
"""
|
|
751
|
-
if not bucket_name:
|
|
752
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
753
|
-
if not object_name:
|
|
754
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
755
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
756
|
-
return self.delete(
|
|
757
|
-
f"/{bucket_name}/{object_name}",
|
|
758
|
-
options=make_request_options(
|
|
759
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
760
|
-
),
|
|
761
|
-
cast_to=NoneType,
|
|
762
|
-
)
|
|
763
|
-
|
|
764
|
-
def delete_objects(
|
|
765
|
-
self,
|
|
766
|
-
bucket_name: str,
|
|
767
|
-
*,
|
|
768
|
-
delete: Literal[True],
|
|
769
|
-
body: Iterable[client_delete_objects_params.Body],
|
|
770
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
771
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
772
|
-
extra_headers: Headers | None = None,
|
|
773
|
-
extra_query: Query | None = None,
|
|
774
|
-
extra_body: Body | None = None,
|
|
775
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
776
|
-
) -> object:
|
|
777
|
-
"""
|
|
778
|
-
Deletes one or multiple objects from a given bucket.
|
|
779
|
-
|
|
780
|
-
Args:
|
|
781
|
-
extra_headers: Send extra headers
|
|
782
|
-
|
|
783
|
-
extra_query: Add additional query parameters to the request
|
|
784
|
-
|
|
785
|
-
extra_body: Add additional JSON properties to the request
|
|
786
|
-
|
|
787
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
788
|
-
"""
|
|
789
|
-
if not bucket_name:
|
|
790
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
791
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
792
|
-
return self.post(
|
|
793
|
-
f"/{bucket_name}",
|
|
794
|
-
body=maybe_transform(body, Iterable[client_delete_objects_params.Body]),
|
|
795
|
-
options=make_request_options(
|
|
796
|
-
extra_headers=extra_headers,
|
|
797
|
-
extra_query=extra_query,
|
|
798
|
-
extra_body=extra_body,
|
|
799
|
-
timeout=timeout,
|
|
800
|
-
query=maybe_transform({"delete": delete}, client_delete_objects_params.ClientDeleteObjectsParams),
|
|
801
|
-
),
|
|
802
|
-
cast_to=object,
|
|
803
|
-
)
|
|
804
|
-
|
|
805
|
-
def get_object(
|
|
806
|
-
self,
|
|
807
|
-
object_name: str,
|
|
808
|
-
*,
|
|
809
|
-
bucket_name: str,
|
|
810
|
-
upload_id: str | NotGiven = NOT_GIVEN,
|
|
811
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
812
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
813
|
-
extra_headers: Headers | None = None,
|
|
814
|
-
extra_query: Query | None = None,
|
|
815
|
-
extra_body: Body | None = None,
|
|
816
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
817
|
-
) -> BinaryAPIResponse:
|
|
818
|
-
"""
|
|
819
|
-
Retrieves an object from a given bucket.
|
|
820
|
-
|
|
821
|
-
Args:
|
|
822
|
-
extra_headers: Send extra headers
|
|
823
|
-
|
|
824
|
-
extra_query: Add additional query parameters to the request
|
|
825
|
-
|
|
826
|
-
extra_body: Add additional JSON properties to the request
|
|
827
|
-
|
|
828
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
829
|
-
"""
|
|
830
|
-
if not bucket_name:
|
|
831
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
832
|
-
if not object_name:
|
|
833
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
834
|
-
extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
|
|
835
|
-
return self.get(
|
|
836
|
-
f"/{bucket_name}/{object_name}",
|
|
837
|
-
options=make_request_options(
|
|
838
|
-
extra_headers=extra_headers,
|
|
839
|
-
extra_query=extra_query,
|
|
840
|
-
extra_body=extra_body,
|
|
841
|
-
timeout=timeout,
|
|
842
|
-
query=maybe_transform({"upload_id": upload_id}, client_get_object_params.ClientGetObjectParams),
|
|
843
|
-
),
|
|
844
|
-
cast_to=BinaryAPIResponse,
|
|
845
|
-
)
|
|
846
|
-
|
|
847
|
-
def list_buckets(
|
|
848
|
-
self,
|
|
849
|
-
*,
|
|
850
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
851
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
852
|
-
extra_headers: Headers | None = None,
|
|
853
|
-
extra_query: Query | None = None,
|
|
854
|
-
extra_body: Body | None = None,
|
|
855
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
856
|
-
) -> ListBucketsResponse:
|
|
857
|
-
"""List all Buckets."""
|
|
858
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
859
|
-
return self.get(
|
|
860
|
-
"/",
|
|
861
|
-
options=make_request_options(
|
|
862
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
863
|
-
),
|
|
864
|
-
cast_to=ListBucketsResponse,
|
|
865
|
-
)
|
|
866
|
-
|
|
867
|
-
def list_objects(
|
|
868
|
-
self,
|
|
869
|
-
bucket_name: str,
|
|
870
|
-
*,
|
|
871
|
-
list_type: Literal[2] | NotGiven = NOT_GIVEN,
|
|
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
|
-
) -> ListObjectsResponse:
|
|
879
|
-
"""
|
|
880
|
-
List all objects contained in a given bucket.
|
|
881
|
-
|
|
882
|
-
Args:
|
|
883
|
-
extra_headers: Send extra headers
|
|
884
|
-
|
|
885
|
-
extra_query: Add additional query parameters to the request
|
|
886
|
-
|
|
887
|
-
extra_body: Add additional JSON properties to the request
|
|
888
|
-
|
|
889
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
890
|
-
"""
|
|
891
|
-
if not bucket_name:
|
|
892
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
893
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
894
|
-
return self.get(
|
|
895
|
-
f"/{bucket_name}",
|
|
896
|
-
options=make_request_options(
|
|
897
|
-
extra_headers=extra_headers,
|
|
898
|
-
extra_query=extra_query,
|
|
899
|
-
extra_body=extra_body,
|
|
900
|
-
timeout=timeout,
|
|
901
|
-
query=maybe_transform({"list_type": list_type}, client_list_objects_params.ClientListObjectsParams),
|
|
902
|
-
),
|
|
903
|
-
cast_to=ListObjectsResponse,
|
|
904
|
-
)
|
|
905
|
-
|
|
906
|
-
def put_object(
|
|
907
|
-
self,
|
|
908
|
-
object_name: str,
|
|
909
|
-
*,
|
|
910
|
-
bucket_name: str,
|
|
911
|
-
body: FileTypes,
|
|
912
|
-
part_number: str | NotGiven = NOT_GIVEN,
|
|
913
|
-
upload_id: str | NotGiven = NOT_GIVEN,
|
|
914
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
915
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
916
|
-
extra_headers: Headers | None = None,
|
|
917
|
-
extra_query: Query | None = None,
|
|
918
|
-
extra_body: Body | None = None,
|
|
919
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
920
|
-
) -> None:
|
|
921
|
-
"""
|
|
922
|
-
Add an object to a bucket.
|
|
923
|
-
|
|
924
|
-
Args:
|
|
925
|
-
extra_headers: Send extra headers
|
|
926
|
-
|
|
927
|
-
extra_query: Add additional query parameters to the request
|
|
928
|
-
|
|
929
|
-
extra_body: Add additional JSON properties to the request
|
|
930
|
-
|
|
931
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
932
|
-
"""
|
|
933
|
-
if not bucket_name:
|
|
934
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
935
|
-
if not object_name:
|
|
936
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
937
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
938
|
-
return self.put(
|
|
939
|
-
f"/{bucket_name}/{object_name}",
|
|
940
|
-
body=maybe_transform(body, client_put_object_params.ClientPutObjectParams),
|
|
941
|
-
options=make_request_options(
|
|
942
|
-
extra_headers=extra_headers,
|
|
943
|
-
extra_query=extra_query,
|
|
944
|
-
extra_body=extra_body,
|
|
945
|
-
timeout=timeout,
|
|
946
|
-
query=maybe_transform(
|
|
947
|
-
{
|
|
948
|
-
"part_number": part_number,
|
|
949
|
-
"upload_id": upload_id,
|
|
950
|
-
},
|
|
951
|
-
client_put_object_params.ClientPutObjectParams,
|
|
952
|
-
),
|
|
953
|
-
),
|
|
954
|
-
cast_to=NoneType,
|
|
955
|
-
)
|
|
956
|
-
|
|
957
638
|
@override
|
|
958
639
|
def _make_status_error(
|
|
959
640
|
self,
|
|
@@ -989,6 +670,10 @@ class Telnyx(SyncAPIClient):
|
|
|
989
670
|
|
|
990
671
|
|
|
991
672
|
class AsyncTelnyx(AsyncAPIClient):
|
|
673
|
+
legacy: legacy.AsyncLegacyResource
|
|
674
|
+
oauth: oauth.AsyncOAuthResource
|
|
675
|
+
oauth_clients: oauth_clients.AsyncOAuthClientsResource
|
|
676
|
+
oauth_grants: oauth_grants.AsyncOAuthGrantsResource
|
|
992
677
|
webhooks: webhooks.AsyncWebhooksResource
|
|
993
678
|
access_ip_address: access_ip_address.AsyncAccessIPAddressResource
|
|
994
679
|
access_ip_ranges: access_ip_ranges.AsyncAccessIPRangesResource
|
|
@@ -1138,6 +823,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1138
823
|
wireless_blocklist_values: wireless_blocklist_values.AsyncWirelessBlocklistValuesResource
|
|
1139
824
|
wireless_blocklists: wireless_blocklists.AsyncWirelessBlocklistsResource
|
|
1140
825
|
partner_campaigns: partner_campaigns.AsyncPartnerCampaignsResource
|
|
826
|
+
well_known: well_known.AsyncWellKnownResource
|
|
1141
827
|
with_raw_response: AsyncTelnyxWithRawResponse
|
|
1142
828
|
with_streaming_response: AsyncTelnyxWithStreamedResponse
|
|
1143
829
|
|
|
@@ -1149,7 +835,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1149
835
|
*,
|
|
1150
836
|
api_key: str | None = None,
|
|
1151
837
|
base_url: str | httpx.URL | None = None,
|
|
1152
|
-
timeout:
|
|
838
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1153
839
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
1154
840
|
default_headers: Mapping[str, str] | None = None,
|
|
1155
841
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -1181,6 +867,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1181
867
|
|
|
1182
868
|
if base_url is None:
|
|
1183
869
|
base_url = os.environ.get("TELNYX_BASE_URL")
|
|
870
|
+
self._base_url_overridden = base_url is not None
|
|
1184
871
|
if base_url is None:
|
|
1185
872
|
base_url = f"https://api.telnyx.com/v2"
|
|
1186
873
|
|
|
@@ -1195,6 +882,10 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1195
882
|
_strict_response_validation=_strict_response_validation,
|
|
1196
883
|
)
|
|
1197
884
|
|
|
885
|
+
self.legacy = legacy.AsyncLegacyResource(self)
|
|
886
|
+
self.oauth = oauth.AsyncOAuthResource(self)
|
|
887
|
+
self.oauth_clients = oauth_clients.AsyncOAuthClientsResource(self)
|
|
888
|
+
self.oauth_grants = oauth_grants.AsyncOAuthGrantsResource(self)
|
|
1198
889
|
self.webhooks = webhooks.AsyncWebhooksResource(self)
|
|
1199
890
|
self.access_ip_address = access_ip_address.AsyncAccessIPAddressResource(self)
|
|
1200
891
|
self.access_ip_ranges = access_ip_ranges.AsyncAccessIPRangesResource(self)
|
|
@@ -1356,6 +1047,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1356
1047
|
self.wireless_blocklist_values = wireless_blocklist_values.AsyncWirelessBlocklistValuesResource(self)
|
|
1357
1048
|
self.wireless_blocklists = wireless_blocklists.AsyncWirelessBlocklistsResource(self)
|
|
1358
1049
|
self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResource(self)
|
|
1050
|
+
self.well_known = well_known.AsyncWellKnownResource(self)
|
|
1359
1051
|
self.with_raw_response = AsyncTelnyxWithRawResponse(self)
|
|
1360
1052
|
self.with_streaming_response = AsyncTelnyxWithStreamedResponse(self)
|
|
1361
1053
|
|
|
@@ -1384,9 +1076,9 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1384
1076
|
*,
|
|
1385
1077
|
api_key: str | None = None,
|
|
1386
1078
|
base_url: str | httpx.URL | None = None,
|
|
1387
|
-
timeout: float | Timeout | None | NotGiven =
|
|
1079
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1388
1080
|
http_client: httpx.AsyncClient | None = None,
|
|
1389
|
-
max_retries: int | NotGiven =
|
|
1081
|
+
max_retries: int | NotGiven = not_given,
|
|
1390
1082
|
default_headers: Mapping[str, str] | None = None,
|
|
1391
1083
|
set_default_headers: Mapping[str, str] | None = None,
|
|
1392
1084
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -1415,7 +1107,7 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1415
1107
|
params = set_default_query
|
|
1416
1108
|
|
|
1417
1109
|
http_client = http_client or self._client
|
|
1418
|
-
|
|
1110
|
+
client = self.__class__(
|
|
1419
1111
|
api_key=api_key or self.api_key,
|
|
1420
1112
|
base_url=base_url or self.base_url,
|
|
1421
1113
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
@@ -1425,320 +1117,13 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1425
1117
|
default_query=params,
|
|
1426
1118
|
**_extra_kwargs,
|
|
1427
1119
|
)
|
|
1120
|
+
client._base_url_overridden = self._base_url_overridden or base_url is not None
|
|
1121
|
+
return client
|
|
1428
1122
|
|
|
1429
1123
|
# Alias for `copy` for nicer inline usage, e.g.
|
|
1430
1124
|
# client.with_options(timeout=10).foo.create(...)
|
|
1431
1125
|
with_options = copy
|
|
1432
1126
|
|
|
1433
|
-
async def create_bucket(
|
|
1434
|
-
self,
|
|
1435
|
-
bucket_name: str,
|
|
1436
|
-
*,
|
|
1437
|
-
location_constraint: str | NotGiven = NOT_GIVEN,
|
|
1438
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1439
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1440
|
-
extra_headers: Headers | None = None,
|
|
1441
|
-
extra_query: Query | None = None,
|
|
1442
|
-
extra_body: Body | None = None,
|
|
1443
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1444
|
-
) -> None:
|
|
1445
|
-
"""
|
|
1446
|
-
Create a bucket.
|
|
1447
|
-
|
|
1448
|
-
Args:
|
|
1449
|
-
extra_headers: Send extra headers
|
|
1450
|
-
|
|
1451
|
-
extra_query: Add additional query parameters to the request
|
|
1452
|
-
|
|
1453
|
-
extra_body: Add additional JSON properties to the request
|
|
1454
|
-
|
|
1455
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1456
|
-
"""
|
|
1457
|
-
if not bucket_name:
|
|
1458
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1459
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1460
|
-
return await self.put(
|
|
1461
|
-
f"/{bucket_name}",
|
|
1462
|
-
body=await async_maybe_transform(
|
|
1463
|
-
{"location_constraint": location_constraint}, client_create_bucket_params.ClientCreateBucketParams
|
|
1464
|
-
),
|
|
1465
|
-
options=make_request_options(
|
|
1466
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1467
|
-
),
|
|
1468
|
-
cast_to=NoneType,
|
|
1469
|
-
)
|
|
1470
|
-
|
|
1471
|
-
async def delete_bucket(
|
|
1472
|
-
self,
|
|
1473
|
-
bucket_name: str,
|
|
1474
|
-
*,
|
|
1475
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1476
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1477
|
-
extra_headers: Headers | None = None,
|
|
1478
|
-
extra_query: Query | None = None,
|
|
1479
|
-
extra_body: Body | None = None,
|
|
1480
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1481
|
-
) -> None:
|
|
1482
|
-
"""Deletes a bucket.
|
|
1483
|
-
|
|
1484
|
-
The bucket must be empty for it to be deleted.
|
|
1485
|
-
|
|
1486
|
-
Args:
|
|
1487
|
-
extra_headers: Send extra headers
|
|
1488
|
-
|
|
1489
|
-
extra_query: Add additional query parameters to the request
|
|
1490
|
-
|
|
1491
|
-
extra_body: Add additional JSON properties to the request
|
|
1492
|
-
|
|
1493
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1494
|
-
"""
|
|
1495
|
-
if not bucket_name:
|
|
1496
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1497
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1498
|
-
return await self.delete(
|
|
1499
|
-
f"/{bucket_name}",
|
|
1500
|
-
options=make_request_options(
|
|
1501
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1502
|
-
),
|
|
1503
|
-
cast_to=NoneType,
|
|
1504
|
-
)
|
|
1505
|
-
|
|
1506
|
-
async def delete_object(
|
|
1507
|
-
self,
|
|
1508
|
-
object_name: str,
|
|
1509
|
-
*,
|
|
1510
|
-
bucket_name: str,
|
|
1511
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1512
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1513
|
-
extra_headers: Headers | None = None,
|
|
1514
|
-
extra_query: Query | None = None,
|
|
1515
|
-
extra_body: Body | None = None,
|
|
1516
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1517
|
-
) -> None:
|
|
1518
|
-
"""
|
|
1519
|
-
Delete an object from a given bucket.
|
|
1520
|
-
|
|
1521
|
-
Args:
|
|
1522
|
-
extra_headers: Send extra headers
|
|
1523
|
-
|
|
1524
|
-
extra_query: Add additional query parameters to the request
|
|
1525
|
-
|
|
1526
|
-
extra_body: Add additional JSON properties to the request
|
|
1527
|
-
|
|
1528
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1529
|
-
"""
|
|
1530
|
-
if not bucket_name:
|
|
1531
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1532
|
-
if not object_name:
|
|
1533
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1534
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1535
|
-
return await self.delete(
|
|
1536
|
-
f"/{bucket_name}/{object_name}",
|
|
1537
|
-
options=make_request_options(
|
|
1538
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1539
|
-
),
|
|
1540
|
-
cast_to=NoneType,
|
|
1541
|
-
)
|
|
1542
|
-
|
|
1543
|
-
async def delete_objects(
|
|
1544
|
-
self,
|
|
1545
|
-
bucket_name: str,
|
|
1546
|
-
*,
|
|
1547
|
-
delete: Literal[True],
|
|
1548
|
-
body: Iterable[client_delete_objects_params.Body],
|
|
1549
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1550
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1551
|
-
extra_headers: Headers | None = None,
|
|
1552
|
-
extra_query: Query | None = None,
|
|
1553
|
-
extra_body: Body | None = None,
|
|
1554
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1555
|
-
) -> object:
|
|
1556
|
-
"""
|
|
1557
|
-
Deletes one or multiple objects from a given bucket.
|
|
1558
|
-
|
|
1559
|
-
Args:
|
|
1560
|
-
extra_headers: Send extra headers
|
|
1561
|
-
|
|
1562
|
-
extra_query: Add additional query parameters to the request
|
|
1563
|
-
|
|
1564
|
-
extra_body: Add additional JSON properties to the request
|
|
1565
|
-
|
|
1566
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1567
|
-
"""
|
|
1568
|
-
if not bucket_name:
|
|
1569
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1570
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1571
|
-
return await self.post(
|
|
1572
|
-
f"/{bucket_name}",
|
|
1573
|
-
body=await async_maybe_transform(body, Iterable[client_delete_objects_params.Body]),
|
|
1574
|
-
options=make_request_options(
|
|
1575
|
-
extra_headers=extra_headers,
|
|
1576
|
-
extra_query=extra_query,
|
|
1577
|
-
extra_body=extra_body,
|
|
1578
|
-
timeout=timeout,
|
|
1579
|
-
query=await async_maybe_transform(
|
|
1580
|
-
{"delete": delete}, client_delete_objects_params.ClientDeleteObjectsParams
|
|
1581
|
-
),
|
|
1582
|
-
),
|
|
1583
|
-
cast_to=object,
|
|
1584
|
-
)
|
|
1585
|
-
|
|
1586
|
-
async def get_object(
|
|
1587
|
-
self,
|
|
1588
|
-
object_name: str,
|
|
1589
|
-
*,
|
|
1590
|
-
bucket_name: str,
|
|
1591
|
-
upload_id: str | NotGiven = NOT_GIVEN,
|
|
1592
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1593
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1594
|
-
extra_headers: Headers | None = None,
|
|
1595
|
-
extra_query: Query | None = None,
|
|
1596
|
-
extra_body: Body | None = None,
|
|
1597
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1598
|
-
) -> AsyncBinaryAPIResponse:
|
|
1599
|
-
"""
|
|
1600
|
-
Retrieves an object from a given bucket.
|
|
1601
|
-
|
|
1602
|
-
Args:
|
|
1603
|
-
extra_headers: Send extra headers
|
|
1604
|
-
|
|
1605
|
-
extra_query: Add additional query parameters to the request
|
|
1606
|
-
|
|
1607
|
-
extra_body: Add additional JSON properties to the request
|
|
1608
|
-
|
|
1609
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1610
|
-
"""
|
|
1611
|
-
if not bucket_name:
|
|
1612
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1613
|
-
if not object_name:
|
|
1614
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1615
|
-
extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
|
|
1616
|
-
return await self.get(
|
|
1617
|
-
f"/{bucket_name}/{object_name}",
|
|
1618
|
-
options=make_request_options(
|
|
1619
|
-
extra_headers=extra_headers,
|
|
1620
|
-
extra_query=extra_query,
|
|
1621
|
-
extra_body=extra_body,
|
|
1622
|
-
timeout=timeout,
|
|
1623
|
-
query=await async_maybe_transform(
|
|
1624
|
-
{"upload_id": upload_id}, client_get_object_params.ClientGetObjectParams
|
|
1625
|
-
),
|
|
1626
|
-
),
|
|
1627
|
-
cast_to=AsyncBinaryAPIResponse,
|
|
1628
|
-
)
|
|
1629
|
-
|
|
1630
|
-
async def list_buckets(
|
|
1631
|
-
self,
|
|
1632
|
-
*,
|
|
1633
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1634
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1635
|
-
extra_headers: Headers | None = None,
|
|
1636
|
-
extra_query: Query | None = None,
|
|
1637
|
-
extra_body: Body | None = None,
|
|
1638
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1639
|
-
) -> ListBucketsResponse:
|
|
1640
|
-
"""List all Buckets."""
|
|
1641
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1642
|
-
return await self.get(
|
|
1643
|
-
"/",
|
|
1644
|
-
options=make_request_options(
|
|
1645
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1646
|
-
),
|
|
1647
|
-
cast_to=ListBucketsResponse,
|
|
1648
|
-
)
|
|
1649
|
-
|
|
1650
|
-
async def list_objects(
|
|
1651
|
-
self,
|
|
1652
|
-
bucket_name: str,
|
|
1653
|
-
*,
|
|
1654
|
-
list_type: Literal[2] | NotGiven = NOT_GIVEN,
|
|
1655
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1656
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1657
|
-
extra_headers: Headers | None = None,
|
|
1658
|
-
extra_query: Query | None = None,
|
|
1659
|
-
extra_body: Body | None = None,
|
|
1660
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1661
|
-
) -> ListObjectsResponse:
|
|
1662
|
-
"""
|
|
1663
|
-
List all objects contained in a given bucket.
|
|
1664
|
-
|
|
1665
|
-
Args:
|
|
1666
|
-
extra_headers: Send extra headers
|
|
1667
|
-
|
|
1668
|
-
extra_query: Add additional query parameters to the request
|
|
1669
|
-
|
|
1670
|
-
extra_body: Add additional JSON properties to the request
|
|
1671
|
-
|
|
1672
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1673
|
-
"""
|
|
1674
|
-
if not bucket_name:
|
|
1675
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1676
|
-
extra_headers = {"Accept": "application/xml", **(extra_headers or {})}
|
|
1677
|
-
return await self.get(
|
|
1678
|
-
f"/{bucket_name}",
|
|
1679
|
-
options=make_request_options(
|
|
1680
|
-
extra_headers=extra_headers,
|
|
1681
|
-
extra_query=extra_query,
|
|
1682
|
-
extra_body=extra_body,
|
|
1683
|
-
timeout=timeout,
|
|
1684
|
-
query=await async_maybe_transform(
|
|
1685
|
-
{"list_type": list_type}, client_list_objects_params.ClientListObjectsParams
|
|
1686
|
-
),
|
|
1687
|
-
),
|
|
1688
|
-
cast_to=ListObjectsResponse,
|
|
1689
|
-
)
|
|
1690
|
-
|
|
1691
|
-
async def put_object(
|
|
1692
|
-
self,
|
|
1693
|
-
object_name: str,
|
|
1694
|
-
*,
|
|
1695
|
-
bucket_name: str,
|
|
1696
|
-
body: FileTypes,
|
|
1697
|
-
part_number: str | NotGiven = NOT_GIVEN,
|
|
1698
|
-
upload_id: str | NotGiven = NOT_GIVEN,
|
|
1699
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1700
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1701
|
-
extra_headers: Headers | None = None,
|
|
1702
|
-
extra_query: Query | None = None,
|
|
1703
|
-
extra_body: Body | None = None,
|
|
1704
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1705
|
-
) -> None:
|
|
1706
|
-
"""
|
|
1707
|
-
Add an object to a bucket.
|
|
1708
|
-
|
|
1709
|
-
Args:
|
|
1710
|
-
extra_headers: Send extra headers
|
|
1711
|
-
|
|
1712
|
-
extra_query: Add additional query parameters to the request
|
|
1713
|
-
|
|
1714
|
-
extra_body: Add additional JSON properties to the request
|
|
1715
|
-
|
|
1716
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1717
|
-
"""
|
|
1718
|
-
if not bucket_name:
|
|
1719
|
-
raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}")
|
|
1720
|
-
if not object_name:
|
|
1721
|
-
raise ValueError(f"Expected a non-empty value for `object_name` but received {object_name!r}")
|
|
1722
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1723
|
-
return await self.put(
|
|
1724
|
-
f"/{bucket_name}/{object_name}",
|
|
1725
|
-
body=await async_maybe_transform(body, client_put_object_params.ClientPutObjectParams),
|
|
1726
|
-
options=make_request_options(
|
|
1727
|
-
extra_headers=extra_headers,
|
|
1728
|
-
extra_query=extra_query,
|
|
1729
|
-
extra_body=extra_body,
|
|
1730
|
-
timeout=timeout,
|
|
1731
|
-
query=await async_maybe_transform(
|
|
1732
|
-
{
|
|
1733
|
-
"part_number": part_number,
|
|
1734
|
-
"upload_id": upload_id,
|
|
1735
|
-
},
|
|
1736
|
-
client_put_object_params.ClientPutObjectParams,
|
|
1737
|
-
),
|
|
1738
|
-
),
|
|
1739
|
-
cast_to=NoneType,
|
|
1740
|
-
)
|
|
1741
|
-
|
|
1742
1127
|
@override
|
|
1743
1128
|
def _make_status_error(
|
|
1744
1129
|
self,
|
|
@@ -1775,6 +1160,10 @@ class AsyncTelnyx(AsyncAPIClient):
|
|
|
1775
1160
|
|
|
1776
1161
|
class TelnyxWithRawResponse:
|
|
1777
1162
|
def __init__(self, client: Telnyx) -> None:
|
|
1163
|
+
self.legacy = legacy.LegacyResourceWithRawResponse(client.legacy)
|
|
1164
|
+
self.oauth = oauth.OAuthResourceWithRawResponse(client.oauth)
|
|
1165
|
+
self.oauth_clients = oauth_clients.OAuthClientsResourceWithRawResponse(client.oauth_clients)
|
|
1166
|
+
self.oauth_grants = oauth_grants.OAuthGrantsResourceWithRawResponse(client.oauth_grants)
|
|
1778
1167
|
self.access_ip_address = access_ip_address.AccessIPAddressResourceWithRawResponse(client.access_ip_address)
|
|
1779
1168
|
self.access_ip_ranges = access_ip_ranges.AccessIPRangesResourceWithRawResponse(client.access_ip_ranges)
|
|
1780
1169
|
self.actions = actions.ActionsResourceWithRawResponse(client.actions)
|
|
@@ -2049,36 +1438,15 @@ class TelnyxWithRawResponse:
|
|
|
2049
1438
|
client.wireless_blocklists
|
|
2050
1439
|
)
|
|
2051
1440
|
self.partner_campaigns = partner_campaigns.PartnerCampaignsResourceWithRawResponse(client.partner_campaigns)
|
|
2052
|
-
|
|
2053
|
-
self.create_bucket = to_raw_response_wrapper(
|
|
2054
|
-
client.create_bucket,
|
|
2055
|
-
)
|
|
2056
|
-
self.delete_bucket = to_raw_response_wrapper(
|
|
2057
|
-
client.delete_bucket,
|
|
2058
|
-
)
|
|
2059
|
-
self.delete_object = to_raw_response_wrapper(
|
|
2060
|
-
client.delete_object,
|
|
2061
|
-
)
|
|
2062
|
-
self.delete_objects = to_raw_response_wrapper(
|
|
2063
|
-
client.delete_objects,
|
|
2064
|
-
)
|
|
2065
|
-
self.get_object = to_custom_raw_response_wrapper(
|
|
2066
|
-
client.get_object,
|
|
2067
|
-
BinaryAPIResponse,
|
|
2068
|
-
)
|
|
2069
|
-
self.list_buckets = to_raw_response_wrapper(
|
|
2070
|
-
client.list_buckets,
|
|
2071
|
-
)
|
|
2072
|
-
self.list_objects = to_raw_response_wrapper(
|
|
2073
|
-
client.list_objects,
|
|
2074
|
-
)
|
|
2075
|
-
self.put_object = to_raw_response_wrapper(
|
|
2076
|
-
client.put_object,
|
|
2077
|
-
)
|
|
1441
|
+
self.well_known = well_known.WellKnownResourceWithRawResponse(client.well_known)
|
|
2078
1442
|
|
|
2079
1443
|
|
|
2080
1444
|
class AsyncTelnyxWithRawResponse:
|
|
2081
1445
|
def __init__(self, client: AsyncTelnyx) -> None:
|
|
1446
|
+
self.legacy = legacy.AsyncLegacyResourceWithRawResponse(client.legacy)
|
|
1447
|
+
self.oauth = oauth.AsyncOAuthResourceWithRawResponse(client.oauth)
|
|
1448
|
+
self.oauth_clients = oauth_clients.AsyncOAuthClientsResourceWithRawResponse(client.oauth_clients)
|
|
1449
|
+
self.oauth_grants = oauth_grants.AsyncOAuthGrantsResourceWithRawResponse(client.oauth_grants)
|
|
2082
1450
|
self.access_ip_address = access_ip_address.AsyncAccessIPAddressResourceWithRawResponse(client.access_ip_address)
|
|
2083
1451
|
self.access_ip_ranges = access_ip_ranges.AsyncAccessIPRangesResourceWithRawResponse(client.access_ip_ranges)
|
|
2084
1452
|
self.actions = actions.AsyncActionsResourceWithRawResponse(client.actions)
|
|
@@ -2393,36 +1761,15 @@ class AsyncTelnyxWithRawResponse:
|
|
|
2393
1761
|
self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResourceWithRawResponse(
|
|
2394
1762
|
client.partner_campaigns
|
|
2395
1763
|
)
|
|
2396
|
-
|
|
2397
|
-
self.create_bucket = async_to_raw_response_wrapper(
|
|
2398
|
-
client.create_bucket,
|
|
2399
|
-
)
|
|
2400
|
-
self.delete_bucket = async_to_raw_response_wrapper(
|
|
2401
|
-
client.delete_bucket,
|
|
2402
|
-
)
|
|
2403
|
-
self.delete_object = async_to_raw_response_wrapper(
|
|
2404
|
-
client.delete_object,
|
|
2405
|
-
)
|
|
2406
|
-
self.delete_objects = async_to_raw_response_wrapper(
|
|
2407
|
-
client.delete_objects,
|
|
2408
|
-
)
|
|
2409
|
-
self.get_object = async_to_custom_raw_response_wrapper(
|
|
2410
|
-
client.get_object,
|
|
2411
|
-
AsyncBinaryAPIResponse,
|
|
2412
|
-
)
|
|
2413
|
-
self.list_buckets = async_to_raw_response_wrapper(
|
|
2414
|
-
client.list_buckets,
|
|
2415
|
-
)
|
|
2416
|
-
self.list_objects = async_to_raw_response_wrapper(
|
|
2417
|
-
client.list_objects,
|
|
2418
|
-
)
|
|
2419
|
-
self.put_object = async_to_raw_response_wrapper(
|
|
2420
|
-
client.put_object,
|
|
2421
|
-
)
|
|
1764
|
+
self.well_known = well_known.AsyncWellKnownResourceWithRawResponse(client.well_known)
|
|
2422
1765
|
|
|
2423
1766
|
|
|
2424
1767
|
class TelnyxWithStreamedResponse:
|
|
2425
1768
|
def __init__(self, client: Telnyx) -> None:
|
|
1769
|
+
self.legacy = legacy.LegacyResourceWithStreamingResponse(client.legacy)
|
|
1770
|
+
self.oauth = oauth.OAuthResourceWithStreamingResponse(client.oauth)
|
|
1771
|
+
self.oauth_clients = oauth_clients.OAuthClientsResourceWithStreamingResponse(client.oauth_clients)
|
|
1772
|
+
self.oauth_grants = oauth_grants.OAuthGrantsResourceWithStreamingResponse(client.oauth_grants)
|
|
2426
1773
|
self.access_ip_address = access_ip_address.AccessIPAddressResourceWithStreamingResponse(
|
|
2427
1774
|
client.access_ip_address
|
|
2428
1775
|
)
|
|
@@ -2743,36 +2090,15 @@ class TelnyxWithStreamedResponse:
|
|
|
2743
2090
|
self.partner_campaigns = partner_campaigns.PartnerCampaignsResourceWithStreamingResponse(
|
|
2744
2091
|
client.partner_campaigns
|
|
2745
2092
|
)
|
|
2746
|
-
|
|
2747
|
-
self.create_bucket = to_streamed_response_wrapper(
|
|
2748
|
-
client.create_bucket,
|
|
2749
|
-
)
|
|
2750
|
-
self.delete_bucket = to_streamed_response_wrapper(
|
|
2751
|
-
client.delete_bucket,
|
|
2752
|
-
)
|
|
2753
|
-
self.delete_object = to_streamed_response_wrapper(
|
|
2754
|
-
client.delete_object,
|
|
2755
|
-
)
|
|
2756
|
-
self.delete_objects = to_streamed_response_wrapper(
|
|
2757
|
-
client.delete_objects,
|
|
2758
|
-
)
|
|
2759
|
-
self.get_object = to_custom_streamed_response_wrapper(
|
|
2760
|
-
client.get_object,
|
|
2761
|
-
StreamedBinaryAPIResponse,
|
|
2762
|
-
)
|
|
2763
|
-
self.list_buckets = to_streamed_response_wrapper(
|
|
2764
|
-
client.list_buckets,
|
|
2765
|
-
)
|
|
2766
|
-
self.list_objects = to_streamed_response_wrapper(
|
|
2767
|
-
client.list_objects,
|
|
2768
|
-
)
|
|
2769
|
-
self.put_object = to_streamed_response_wrapper(
|
|
2770
|
-
client.put_object,
|
|
2771
|
-
)
|
|
2093
|
+
self.well_known = well_known.WellKnownResourceWithStreamingResponse(client.well_known)
|
|
2772
2094
|
|
|
2773
2095
|
|
|
2774
2096
|
class AsyncTelnyxWithStreamedResponse:
|
|
2775
2097
|
def __init__(self, client: AsyncTelnyx) -> None:
|
|
2098
|
+
self.legacy = legacy.AsyncLegacyResourceWithStreamingResponse(client.legacy)
|
|
2099
|
+
self.oauth = oauth.AsyncOAuthResourceWithStreamingResponse(client.oauth)
|
|
2100
|
+
self.oauth_clients = oauth_clients.AsyncOAuthClientsResourceWithStreamingResponse(client.oauth_clients)
|
|
2101
|
+
self.oauth_grants = oauth_grants.AsyncOAuthGrantsResourceWithStreamingResponse(client.oauth_grants)
|
|
2776
2102
|
self.access_ip_address = access_ip_address.AsyncAccessIPAddressResourceWithStreamingResponse(
|
|
2777
2103
|
client.access_ip_address
|
|
2778
2104
|
)
|
|
@@ -3135,32 +2461,7 @@ class AsyncTelnyxWithStreamedResponse:
|
|
|
3135
2461
|
self.partner_campaigns = partner_campaigns.AsyncPartnerCampaignsResourceWithStreamingResponse(
|
|
3136
2462
|
client.partner_campaigns
|
|
3137
2463
|
)
|
|
3138
|
-
|
|
3139
|
-
self.create_bucket = async_to_streamed_response_wrapper(
|
|
3140
|
-
client.create_bucket,
|
|
3141
|
-
)
|
|
3142
|
-
self.delete_bucket = async_to_streamed_response_wrapper(
|
|
3143
|
-
client.delete_bucket,
|
|
3144
|
-
)
|
|
3145
|
-
self.delete_object = async_to_streamed_response_wrapper(
|
|
3146
|
-
client.delete_object,
|
|
3147
|
-
)
|
|
3148
|
-
self.delete_objects = async_to_streamed_response_wrapper(
|
|
3149
|
-
client.delete_objects,
|
|
3150
|
-
)
|
|
3151
|
-
self.get_object = async_to_custom_streamed_response_wrapper(
|
|
3152
|
-
client.get_object,
|
|
3153
|
-
AsyncStreamedBinaryAPIResponse,
|
|
3154
|
-
)
|
|
3155
|
-
self.list_buckets = async_to_streamed_response_wrapper(
|
|
3156
|
-
client.list_buckets,
|
|
3157
|
-
)
|
|
3158
|
-
self.list_objects = async_to_streamed_response_wrapper(
|
|
3159
|
-
client.list_objects,
|
|
3160
|
-
)
|
|
3161
|
-
self.put_object = async_to_streamed_response_wrapper(
|
|
3162
|
-
client.put_object,
|
|
3163
|
-
)
|
|
2464
|
+
self.well_known = well_known.AsyncWellKnownResourceWithStreamingResponse(client.well_known)
|
|
3164
2465
|
|
|
3165
2466
|
|
|
3166
2467
|
Client = Telnyx
|