telnyx 3.4.0a0__py3-none-any.whl → 3.5.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 +9 -9
- telnyx/_client.py +63 -762
- telnyx/_models.py +10 -4
- telnyx/_qs.py +7 -7
- telnyx/_types.py +18 -11
- telnyx/_utils/_transform.py +2 -2
- telnyx/_utils/_utils.py +4 -4
- 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 -13
- telnyx/resources/actions/register.py +9 -9
- 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 +91 -91
- 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 +47 -47
- telnyx/resources/ai/clusters.py +27 -27
- 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 -23
- 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 +63 -67
- telnyx/resources/call_events.py +7 -7
- telnyx/resources/calls/actions.py +699 -699
- telnyx/resources/calls/calls.py +113 -107
- 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 +67 -67
- 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 +121 -137
- 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 +95 -95
- telnyx/resources/custom_storage_credentials.py +9 -9
- telnyx/resources/customer_service_records.py +19 -19
- telnyx/resources/detail_records.py +9 -9
- 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 +41 -41
- 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 +25 -27
- telnyx/resources/fax_applications.py +47 -47
- telnyx/resources/faxes/actions.py +5 -5
- telnyx/resources/faxes/faxes.py +35 -35
- telnyx/resources/fqdn_connections.py +93 -93
- 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 +93 -93
- 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 +121 -121
- telnyx/resources/messages/rcs.py +7 -7
- telnyx/resources/messaging/rcs/agents.py +15 -15
- telnyx/resources/messaging/rcs/rcs.py +7 -7
- telnyx/resources/messaging_hosted_number_orders/actions.py +7 -7
- telnyx/resources/messaging_hosted_number_orders/messaging_hosted_number_orders.py +21 -21
- telnyx/resources/messaging_hosted_numbers.py +3 -3
- telnyx/resources/messaging_numbers_bulk_updates.py +5 -5
- telnyx/resources/messaging_optouts.py +11 -11
- telnyx/resources/messaging_profiles/autoresp_configs.py +21 -21
- telnyx/resources/messaging_profiles/messaging_profiles.py +89 -73
- telnyx/resources/messaging_tollfree/verification/requests.py +233 -28
- 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 +3 -3
- 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 +89 -69
- 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 +7 -7
- telnyx/resources/phone_numbers/csv_downloads.py +13 -13
- telnyx/resources/phone_numbers/jobs.py +47 -35
- telnyx/resources/phone_numbers/messaging.py +13 -13
- telnyx/resources/phone_numbers/phone_numbers.py +39 -39
- 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 -5
- 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 +79 -67
- telnyx/resources/porting_orders/verification_codes.py +19 -19
- 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 +3 -3
- 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 +21 -21
- telnyx/resources/reports/reports.py +47 -47
- 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 +21 -21
- 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 +39 -39
- telnyx/resources/sim_cards/sim_cards.py +48 -47
- 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 -65
- telnyx/resources/text_to_speech.py +9 -9
- telnyx/resources/usage_reports.py +27 -27
- 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 +27 -27
- telnyx/types/__init__.py +49 -9
- 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/assistant_import_params.py +1 -1
- telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
- telnyx/types/ai/conversations/__init__.py +0 -1
- telnyx/types/ai/import_metadata.py +1 -1
- 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 +2 -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_dial_params.py +10 -3
- telnyx/types/calls/action_answer_params.py +1 -2
- telnyx/types/calls/action_gather_using_ai_params.py +5 -8
- telnyx/types/calls/action_start_streaming_params.py +4 -2
- telnyx/types/calls/action_start_transcription_params.py +260 -6
- telnyx/types/calls/action_transfer_params.py +50 -0
- telnyx/types/calls/transcription_start_request_param.py +261 -6
- telnyx/types/campaign_submit_appeal_response.py +0 -3
- telnyx/types/country_coverage_retrieve_country_response.py +7 -0
- telnyx/types/country_coverage_retrieve_response.py +7 -0
- telnyx/types/global_ip_latency_retrieve_response.py +7 -7
- 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/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/request_create_params.py +54 -2
- telnyx/types/messaging_tollfree/verification/request_update_params.py +54 -2
- telnyx/types/messaging_tollfree/verification/verification_request_egress.py +26 -0
- telnyx/types/messaging_tollfree/verification/verification_request_status.py +26 -0
- telnyx/types/number_order_status_update_webhook_event.py +30 -4
- 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_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/phone_number_delete_response.py +7 -0
- telnyx/types/phone_number_detailed.py +7 -0
- telnyx/types/phone_number_list_params.py +6 -0
- telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
- telnyx/types/porting_order.py +3 -0
- telnyx/types/porting_order_create_params.py +3 -0
- telnyx/types/porting_order_list_params.py +52 -31
- telnyx/types/porting_order_update_params.py +2 -0
- telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
- telnyx/types/requirement_group.py +2 -2
- telnyx/types/requirement_group_list_params.py +1 -1
- 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_update_params.py +2 -1
- 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/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_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_template_params.py +12 -0
- telnyx/types/verify_profile_update_template_response.py +12 -0
- telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
- telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
- {telnyx-3.4.0a0.dist-info → telnyx-3.5.0.dist-info}/METADATA +60 -19
- {telnyx-3.4.0a0.dist-info → telnyx-3.5.0.dist-info}/RECORD +412 -327
- 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.4.0a0.dist-info → telnyx-3.5.0.dist-info}/WHEEL +0 -0
- {telnyx-3.4.0a0.dist-info → telnyx-3.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,855 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ..types import (
|
|
11
|
+
oauth_token_params,
|
|
12
|
+
oauth_grants_params,
|
|
13
|
+
oauth_register_params,
|
|
14
|
+
oauth_introspect_params,
|
|
15
|
+
oauth_retrieve_authorize_params,
|
|
16
|
+
)
|
|
17
|
+
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
|
|
18
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
19
|
+
from .._compat import cached_property
|
|
20
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
21
|
+
from .._response import (
|
|
22
|
+
to_raw_response_wrapper,
|
|
23
|
+
to_streamed_response_wrapper,
|
|
24
|
+
async_to_raw_response_wrapper,
|
|
25
|
+
async_to_streamed_response_wrapper,
|
|
26
|
+
)
|
|
27
|
+
from .._base_client import make_request_options
|
|
28
|
+
from ..types.oauth_token_response import OAuthTokenResponse
|
|
29
|
+
from ..types.oauth_grants_response import OAuthGrantsResponse
|
|
30
|
+
from ..types.oauth_register_response import OAuthRegisterResponse
|
|
31
|
+
from ..types.oauth_retrieve_response import OAuthRetrieveResponse
|
|
32
|
+
from ..types.oauth_introspect_response import OAuthIntrospectResponse
|
|
33
|
+
from ..types.oauth_retrieve_jwks_response import OAuthRetrieveJwksResponse
|
|
34
|
+
|
|
35
|
+
__all__ = ["OAuthResource", "AsyncOAuthResource"]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class OAuthResource(SyncAPIResource):
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_raw_response(self) -> OAuthResourceWithRawResponse:
|
|
41
|
+
"""
|
|
42
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
43
|
+
the raw response object instead of the parsed content.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
|
|
46
|
+
"""
|
|
47
|
+
return OAuthResourceWithRawResponse(self)
|
|
48
|
+
|
|
49
|
+
@cached_property
|
|
50
|
+
def with_streaming_response(self) -> OAuthResourceWithStreamingResponse:
|
|
51
|
+
"""
|
|
52
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
53
|
+
|
|
54
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
|
|
55
|
+
"""
|
|
56
|
+
return OAuthResourceWithStreamingResponse(self)
|
|
57
|
+
|
|
58
|
+
def retrieve(
|
|
59
|
+
self,
|
|
60
|
+
consent_token: str,
|
|
61
|
+
*,
|
|
62
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
63
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
64
|
+
extra_headers: Headers | None = None,
|
|
65
|
+
extra_query: Query | None = None,
|
|
66
|
+
extra_body: Body | None = None,
|
|
67
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
68
|
+
) -> OAuthRetrieveResponse:
|
|
69
|
+
"""
|
|
70
|
+
Retrieve details about an OAuth consent token
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
extra_headers: Send extra headers
|
|
74
|
+
|
|
75
|
+
extra_query: Add additional query parameters to the request
|
|
76
|
+
|
|
77
|
+
extra_body: Add additional JSON properties to the request
|
|
78
|
+
|
|
79
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
80
|
+
"""
|
|
81
|
+
if not consent_token:
|
|
82
|
+
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
83
|
+
return self._get(
|
|
84
|
+
f"/oauth/consent/{consent_token}",
|
|
85
|
+
options=make_request_options(
|
|
86
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
87
|
+
),
|
|
88
|
+
cast_to=OAuthRetrieveResponse,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def grants(
|
|
92
|
+
self,
|
|
93
|
+
*,
|
|
94
|
+
allowed: bool,
|
|
95
|
+
consent_token: str,
|
|
96
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
97
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
98
|
+
extra_headers: Headers | None = None,
|
|
99
|
+
extra_query: Query | None = None,
|
|
100
|
+
extra_body: Body | None = None,
|
|
101
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
102
|
+
) -> OAuthGrantsResponse:
|
|
103
|
+
"""
|
|
104
|
+
Create an OAuth authorization grant
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
allowed: Whether the grant is allowed
|
|
108
|
+
|
|
109
|
+
consent_token: Consent token
|
|
110
|
+
|
|
111
|
+
extra_headers: Send extra headers
|
|
112
|
+
|
|
113
|
+
extra_query: Add additional query parameters to the request
|
|
114
|
+
|
|
115
|
+
extra_body: Add additional JSON properties to the request
|
|
116
|
+
|
|
117
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
118
|
+
"""
|
|
119
|
+
return self._post(
|
|
120
|
+
"/oauth/grants",
|
|
121
|
+
body=maybe_transform(
|
|
122
|
+
{
|
|
123
|
+
"allowed": allowed,
|
|
124
|
+
"consent_token": consent_token,
|
|
125
|
+
},
|
|
126
|
+
oauth_grants_params.OAuthGrantsParams,
|
|
127
|
+
),
|
|
128
|
+
options=make_request_options(
|
|
129
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
130
|
+
),
|
|
131
|
+
cast_to=OAuthGrantsResponse,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
def introspect(
|
|
135
|
+
self,
|
|
136
|
+
*,
|
|
137
|
+
token: str,
|
|
138
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
139
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
140
|
+
extra_headers: Headers | None = None,
|
|
141
|
+
extra_query: Query | None = None,
|
|
142
|
+
extra_body: Body | None = None,
|
|
143
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
144
|
+
) -> OAuthIntrospectResponse:
|
|
145
|
+
"""
|
|
146
|
+
Introspect an OAuth access token to check its validity and metadata
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
token: The token to introspect
|
|
150
|
+
|
|
151
|
+
extra_headers: Send extra headers
|
|
152
|
+
|
|
153
|
+
extra_query: Add additional query parameters to the request
|
|
154
|
+
|
|
155
|
+
extra_body: Add additional JSON properties to the request
|
|
156
|
+
|
|
157
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
158
|
+
"""
|
|
159
|
+
return self._post(
|
|
160
|
+
"/oauth/introspect",
|
|
161
|
+
body=maybe_transform({"token": token}, oauth_introspect_params.OAuthIntrospectParams),
|
|
162
|
+
options=make_request_options(
|
|
163
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
164
|
+
),
|
|
165
|
+
cast_to=OAuthIntrospectResponse,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
def register(
|
|
169
|
+
self,
|
|
170
|
+
*,
|
|
171
|
+
client_name: str | Omit = omit,
|
|
172
|
+
grant_types: List[Literal["authorization_code", "client_credentials", "refresh_token"]] | Omit = omit,
|
|
173
|
+
logo_uri: str | Omit = omit,
|
|
174
|
+
policy_uri: str | Omit = omit,
|
|
175
|
+
redirect_uris: SequenceNotStr[str] | Omit = omit,
|
|
176
|
+
response_types: SequenceNotStr[str] | Omit = omit,
|
|
177
|
+
scope: str | Omit = omit,
|
|
178
|
+
token_endpoint_auth_method: Literal["none", "client_secret_basic", "client_secret_post"] | Omit = omit,
|
|
179
|
+
tos_uri: str | Omit = omit,
|
|
180
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
181
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
182
|
+
extra_headers: Headers | None = None,
|
|
183
|
+
extra_query: Query | None = None,
|
|
184
|
+
extra_body: Body | None = None,
|
|
185
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
186
|
+
) -> OAuthRegisterResponse:
|
|
187
|
+
"""
|
|
188
|
+
Register a new OAuth client dynamically (RFC 7591)
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
client_name: Human-readable string name of the client to be presented to the end-user
|
|
192
|
+
|
|
193
|
+
grant_types: Array of OAuth 2.0 grant type strings that the client may use
|
|
194
|
+
|
|
195
|
+
logo_uri: URL of the client logo
|
|
196
|
+
|
|
197
|
+
policy_uri: URL of the client's privacy policy
|
|
198
|
+
|
|
199
|
+
redirect_uris: Array of redirection URI strings for use in redirect-based flows
|
|
200
|
+
|
|
201
|
+
response_types: Array of the OAuth 2.0 response type strings that the client may use
|
|
202
|
+
|
|
203
|
+
scope: Space-separated string of scope values that the client may use
|
|
204
|
+
|
|
205
|
+
token_endpoint_auth_method: Authentication method for the token endpoint
|
|
206
|
+
|
|
207
|
+
tos_uri: URL of the client's terms of service
|
|
208
|
+
|
|
209
|
+
extra_headers: Send extra headers
|
|
210
|
+
|
|
211
|
+
extra_query: Add additional query parameters to the request
|
|
212
|
+
|
|
213
|
+
extra_body: Add additional JSON properties to the request
|
|
214
|
+
|
|
215
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
216
|
+
"""
|
|
217
|
+
return self._post(
|
|
218
|
+
"/oauth/register",
|
|
219
|
+
body=maybe_transform(
|
|
220
|
+
{
|
|
221
|
+
"client_name": client_name,
|
|
222
|
+
"grant_types": grant_types,
|
|
223
|
+
"logo_uri": logo_uri,
|
|
224
|
+
"policy_uri": policy_uri,
|
|
225
|
+
"redirect_uris": redirect_uris,
|
|
226
|
+
"response_types": response_types,
|
|
227
|
+
"scope": scope,
|
|
228
|
+
"token_endpoint_auth_method": token_endpoint_auth_method,
|
|
229
|
+
"tos_uri": tos_uri,
|
|
230
|
+
},
|
|
231
|
+
oauth_register_params.OAuthRegisterParams,
|
|
232
|
+
),
|
|
233
|
+
options=make_request_options(
|
|
234
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
235
|
+
),
|
|
236
|
+
cast_to=OAuthRegisterResponse,
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
def retrieve_authorize(
|
|
240
|
+
self,
|
|
241
|
+
*,
|
|
242
|
+
client_id: str,
|
|
243
|
+
redirect_uri: str,
|
|
244
|
+
response_type: Literal["code"],
|
|
245
|
+
code_challenge: str | Omit = omit,
|
|
246
|
+
code_challenge_method: Literal["plain", "S256"] | Omit = omit,
|
|
247
|
+
scope: str | Omit = omit,
|
|
248
|
+
state: str | Omit = omit,
|
|
249
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
250
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
251
|
+
extra_headers: Headers | None = None,
|
|
252
|
+
extra_query: Query | None = None,
|
|
253
|
+
extra_body: Body | None = None,
|
|
254
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
255
|
+
) -> None:
|
|
256
|
+
"""
|
|
257
|
+
OAuth 2.0 authorization endpoint for the authorization code flow
|
|
258
|
+
|
|
259
|
+
Args:
|
|
260
|
+
client_id: OAuth client identifier
|
|
261
|
+
|
|
262
|
+
redirect_uri: Redirect URI
|
|
263
|
+
|
|
264
|
+
response_type: OAuth response type
|
|
265
|
+
|
|
266
|
+
code_challenge: PKCE code challenge
|
|
267
|
+
|
|
268
|
+
code_challenge_method: PKCE code challenge method
|
|
269
|
+
|
|
270
|
+
scope: Space-separated list of requested scopes
|
|
271
|
+
|
|
272
|
+
state: State parameter for CSRF protection
|
|
273
|
+
|
|
274
|
+
extra_headers: Send extra headers
|
|
275
|
+
|
|
276
|
+
extra_query: Add additional query parameters to the request
|
|
277
|
+
|
|
278
|
+
extra_body: Add additional JSON properties to the request
|
|
279
|
+
|
|
280
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
281
|
+
"""
|
|
282
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
283
|
+
return self._get(
|
|
284
|
+
"/oauth/authorize",
|
|
285
|
+
options=make_request_options(
|
|
286
|
+
extra_headers=extra_headers,
|
|
287
|
+
extra_query=extra_query,
|
|
288
|
+
extra_body=extra_body,
|
|
289
|
+
timeout=timeout,
|
|
290
|
+
query=maybe_transform(
|
|
291
|
+
{
|
|
292
|
+
"client_id": client_id,
|
|
293
|
+
"redirect_uri": redirect_uri,
|
|
294
|
+
"response_type": response_type,
|
|
295
|
+
"code_challenge": code_challenge,
|
|
296
|
+
"code_challenge_method": code_challenge_method,
|
|
297
|
+
"scope": scope,
|
|
298
|
+
"state": state,
|
|
299
|
+
},
|
|
300
|
+
oauth_retrieve_authorize_params.OAuthRetrieveAuthorizeParams,
|
|
301
|
+
),
|
|
302
|
+
),
|
|
303
|
+
cast_to=NoneType,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
def retrieve_jwks(
|
|
307
|
+
self,
|
|
308
|
+
*,
|
|
309
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
310
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
311
|
+
extra_headers: Headers | None = None,
|
|
312
|
+
extra_query: Query | None = None,
|
|
313
|
+
extra_body: Body | None = None,
|
|
314
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
315
|
+
) -> OAuthRetrieveJwksResponse:
|
|
316
|
+
"""Retrieve the JSON Web Key Set for token verification"""
|
|
317
|
+
return self._get(
|
|
318
|
+
"/oauth/jwks",
|
|
319
|
+
options=make_request_options(
|
|
320
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
321
|
+
),
|
|
322
|
+
cast_to=OAuthRetrieveJwksResponse,
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
def token(
|
|
326
|
+
self,
|
|
327
|
+
*,
|
|
328
|
+
grant_type: Literal["client_credentials", "authorization_code", "refresh_token"],
|
|
329
|
+
client_id: str | Omit = omit,
|
|
330
|
+
client_secret: str | Omit = omit,
|
|
331
|
+
code: str | Omit = omit,
|
|
332
|
+
code_verifier: str | Omit = omit,
|
|
333
|
+
redirect_uri: str | Omit = omit,
|
|
334
|
+
refresh_token: str | Omit = omit,
|
|
335
|
+
scope: str | Omit = omit,
|
|
336
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
337
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
338
|
+
extra_headers: Headers | None = None,
|
|
339
|
+
extra_query: Query | None = None,
|
|
340
|
+
extra_body: Body | None = None,
|
|
341
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
342
|
+
) -> OAuthTokenResponse:
|
|
343
|
+
"""
|
|
344
|
+
Exchange authorization code, client credentials, or refresh token for access
|
|
345
|
+
token
|
|
346
|
+
|
|
347
|
+
Args:
|
|
348
|
+
grant_type: OAuth 2.0 grant type
|
|
349
|
+
|
|
350
|
+
client_id: OAuth client ID (if not using HTTP Basic auth)
|
|
351
|
+
|
|
352
|
+
client_secret: OAuth client secret (if not using HTTP Basic auth)
|
|
353
|
+
|
|
354
|
+
code: Authorization code (for authorization_code flow)
|
|
355
|
+
|
|
356
|
+
code_verifier: PKCE code verifier (for authorization_code flow)
|
|
357
|
+
|
|
358
|
+
redirect_uri: Redirect URI (for authorization_code flow)
|
|
359
|
+
|
|
360
|
+
refresh_token: Refresh token (for refresh_token flow)
|
|
361
|
+
|
|
362
|
+
scope: Space-separated list of requested scopes (for client_credentials)
|
|
363
|
+
|
|
364
|
+
extra_headers: Send extra headers
|
|
365
|
+
|
|
366
|
+
extra_query: Add additional query parameters to the request
|
|
367
|
+
|
|
368
|
+
extra_body: Add additional JSON properties to the request
|
|
369
|
+
|
|
370
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
371
|
+
"""
|
|
372
|
+
return self._post(
|
|
373
|
+
"/oauth/token",
|
|
374
|
+
body=maybe_transform(
|
|
375
|
+
{
|
|
376
|
+
"grant_type": grant_type,
|
|
377
|
+
"client_id": client_id,
|
|
378
|
+
"client_secret": client_secret,
|
|
379
|
+
"code": code,
|
|
380
|
+
"code_verifier": code_verifier,
|
|
381
|
+
"redirect_uri": redirect_uri,
|
|
382
|
+
"refresh_token": refresh_token,
|
|
383
|
+
"scope": scope,
|
|
384
|
+
},
|
|
385
|
+
oauth_token_params.OAuthTokenParams,
|
|
386
|
+
),
|
|
387
|
+
options=make_request_options(
|
|
388
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
389
|
+
),
|
|
390
|
+
cast_to=OAuthTokenResponse,
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
class AsyncOAuthResource(AsyncAPIResource):
|
|
395
|
+
@cached_property
|
|
396
|
+
def with_raw_response(self) -> AsyncOAuthResourceWithRawResponse:
|
|
397
|
+
"""
|
|
398
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
399
|
+
the raw response object instead of the parsed content.
|
|
400
|
+
|
|
401
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
|
|
402
|
+
"""
|
|
403
|
+
return AsyncOAuthResourceWithRawResponse(self)
|
|
404
|
+
|
|
405
|
+
@cached_property
|
|
406
|
+
def with_streaming_response(self) -> AsyncOAuthResourceWithStreamingResponse:
|
|
407
|
+
"""
|
|
408
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
409
|
+
|
|
410
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
|
|
411
|
+
"""
|
|
412
|
+
return AsyncOAuthResourceWithStreamingResponse(self)
|
|
413
|
+
|
|
414
|
+
async def retrieve(
|
|
415
|
+
self,
|
|
416
|
+
consent_token: str,
|
|
417
|
+
*,
|
|
418
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
419
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
420
|
+
extra_headers: Headers | None = None,
|
|
421
|
+
extra_query: Query | None = None,
|
|
422
|
+
extra_body: Body | None = None,
|
|
423
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
424
|
+
) -> OAuthRetrieveResponse:
|
|
425
|
+
"""
|
|
426
|
+
Retrieve details about an OAuth consent token
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
extra_headers: Send extra headers
|
|
430
|
+
|
|
431
|
+
extra_query: Add additional query parameters to the request
|
|
432
|
+
|
|
433
|
+
extra_body: Add additional JSON properties to the request
|
|
434
|
+
|
|
435
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
436
|
+
"""
|
|
437
|
+
if not consent_token:
|
|
438
|
+
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
439
|
+
return await self._get(
|
|
440
|
+
f"/oauth/consent/{consent_token}",
|
|
441
|
+
options=make_request_options(
|
|
442
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
443
|
+
),
|
|
444
|
+
cast_to=OAuthRetrieveResponse,
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
async def grants(
|
|
448
|
+
self,
|
|
449
|
+
*,
|
|
450
|
+
allowed: bool,
|
|
451
|
+
consent_token: str,
|
|
452
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
453
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
454
|
+
extra_headers: Headers | None = None,
|
|
455
|
+
extra_query: Query | None = None,
|
|
456
|
+
extra_body: Body | None = None,
|
|
457
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
458
|
+
) -> OAuthGrantsResponse:
|
|
459
|
+
"""
|
|
460
|
+
Create an OAuth authorization grant
|
|
461
|
+
|
|
462
|
+
Args:
|
|
463
|
+
allowed: Whether the grant is allowed
|
|
464
|
+
|
|
465
|
+
consent_token: Consent token
|
|
466
|
+
|
|
467
|
+
extra_headers: Send extra headers
|
|
468
|
+
|
|
469
|
+
extra_query: Add additional query parameters to the request
|
|
470
|
+
|
|
471
|
+
extra_body: Add additional JSON properties to the request
|
|
472
|
+
|
|
473
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
474
|
+
"""
|
|
475
|
+
return await self._post(
|
|
476
|
+
"/oauth/grants",
|
|
477
|
+
body=await async_maybe_transform(
|
|
478
|
+
{
|
|
479
|
+
"allowed": allowed,
|
|
480
|
+
"consent_token": consent_token,
|
|
481
|
+
},
|
|
482
|
+
oauth_grants_params.OAuthGrantsParams,
|
|
483
|
+
),
|
|
484
|
+
options=make_request_options(
|
|
485
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
486
|
+
),
|
|
487
|
+
cast_to=OAuthGrantsResponse,
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
async def introspect(
|
|
491
|
+
self,
|
|
492
|
+
*,
|
|
493
|
+
token: str,
|
|
494
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
495
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
496
|
+
extra_headers: Headers | None = None,
|
|
497
|
+
extra_query: Query | None = None,
|
|
498
|
+
extra_body: Body | None = None,
|
|
499
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
500
|
+
) -> OAuthIntrospectResponse:
|
|
501
|
+
"""
|
|
502
|
+
Introspect an OAuth access token to check its validity and metadata
|
|
503
|
+
|
|
504
|
+
Args:
|
|
505
|
+
token: The token to introspect
|
|
506
|
+
|
|
507
|
+
extra_headers: Send extra headers
|
|
508
|
+
|
|
509
|
+
extra_query: Add additional query parameters to the request
|
|
510
|
+
|
|
511
|
+
extra_body: Add additional JSON properties to the request
|
|
512
|
+
|
|
513
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
514
|
+
"""
|
|
515
|
+
return await self._post(
|
|
516
|
+
"/oauth/introspect",
|
|
517
|
+
body=await async_maybe_transform({"token": token}, oauth_introspect_params.OAuthIntrospectParams),
|
|
518
|
+
options=make_request_options(
|
|
519
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
520
|
+
),
|
|
521
|
+
cast_to=OAuthIntrospectResponse,
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
async def register(
|
|
525
|
+
self,
|
|
526
|
+
*,
|
|
527
|
+
client_name: str | Omit = omit,
|
|
528
|
+
grant_types: List[Literal["authorization_code", "client_credentials", "refresh_token"]] | Omit = omit,
|
|
529
|
+
logo_uri: str | Omit = omit,
|
|
530
|
+
policy_uri: str | Omit = omit,
|
|
531
|
+
redirect_uris: SequenceNotStr[str] | Omit = omit,
|
|
532
|
+
response_types: SequenceNotStr[str] | Omit = omit,
|
|
533
|
+
scope: str | Omit = omit,
|
|
534
|
+
token_endpoint_auth_method: Literal["none", "client_secret_basic", "client_secret_post"] | Omit = omit,
|
|
535
|
+
tos_uri: str | Omit = omit,
|
|
536
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
537
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
538
|
+
extra_headers: Headers | None = None,
|
|
539
|
+
extra_query: Query | None = None,
|
|
540
|
+
extra_body: Body | None = None,
|
|
541
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
542
|
+
) -> OAuthRegisterResponse:
|
|
543
|
+
"""
|
|
544
|
+
Register a new OAuth client dynamically (RFC 7591)
|
|
545
|
+
|
|
546
|
+
Args:
|
|
547
|
+
client_name: Human-readable string name of the client to be presented to the end-user
|
|
548
|
+
|
|
549
|
+
grant_types: Array of OAuth 2.0 grant type strings that the client may use
|
|
550
|
+
|
|
551
|
+
logo_uri: URL of the client logo
|
|
552
|
+
|
|
553
|
+
policy_uri: URL of the client's privacy policy
|
|
554
|
+
|
|
555
|
+
redirect_uris: Array of redirection URI strings for use in redirect-based flows
|
|
556
|
+
|
|
557
|
+
response_types: Array of the OAuth 2.0 response type strings that the client may use
|
|
558
|
+
|
|
559
|
+
scope: Space-separated string of scope values that the client may use
|
|
560
|
+
|
|
561
|
+
token_endpoint_auth_method: Authentication method for the token endpoint
|
|
562
|
+
|
|
563
|
+
tos_uri: URL of the client's terms of service
|
|
564
|
+
|
|
565
|
+
extra_headers: Send extra headers
|
|
566
|
+
|
|
567
|
+
extra_query: Add additional query parameters to the request
|
|
568
|
+
|
|
569
|
+
extra_body: Add additional JSON properties to the request
|
|
570
|
+
|
|
571
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
572
|
+
"""
|
|
573
|
+
return await self._post(
|
|
574
|
+
"/oauth/register",
|
|
575
|
+
body=await async_maybe_transform(
|
|
576
|
+
{
|
|
577
|
+
"client_name": client_name,
|
|
578
|
+
"grant_types": grant_types,
|
|
579
|
+
"logo_uri": logo_uri,
|
|
580
|
+
"policy_uri": policy_uri,
|
|
581
|
+
"redirect_uris": redirect_uris,
|
|
582
|
+
"response_types": response_types,
|
|
583
|
+
"scope": scope,
|
|
584
|
+
"token_endpoint_auth_method": token_endpoint_auth_method,
|
|
585
|
+
"tos_uri": tos_uri,
|
|
586
|
+
},
|
|
587
|
+
oauth_register_params.OAuthRegisterParams,
|
|
588
|
+
),
|
|
589
|
+
options=make_request_options(
|
|
590
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
591
|
+
),
|
|
592
|
+
cast_to=OAuthRegisterResponse,
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
async def retrieve_authorize(
|
|
596
|
+
self,
|
|
597
|
+
*,
|
|
598
|
+
client_id: str,
|
|
599
|
+
redirect_uri: str,
|
|
600
|
+
response_type: Literal["code"],
|
|
601
|
+
code_challenge: str | Omit = omit,
|
|
602
|
+
code_challenge_method: Literal["plain", "S256"] | Omit = omit,
|
|
603
|
+
scope: str | Omit = omit,
|
|
604
|
+
state: str | Omit = omit,
|
|
605
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
606
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
607
|
+
extra_headers: Headers | None = None,
|
|
608
|
+
extra_query: Query | None = None,
|
|
609
|
+
extra_body: Body | None = None,
|
|
610
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
611
|
+
) -> None:
|
|
612
|
+
"""
|
|
613
|
+
OAuth 2.0 authorization endpoint for the authorization code flow
|
|
614
|
+
|
|
615
|
+
Args:
|
|
616
|
+
client_id: OAuth client identifier
|
|
617
|
+
|
|
618
|
+
redirect_uri: Redirect URI
|
|
619
|
+
|
|
620
|
+
response_type: OAuth response type
|
|
621
|
+
|
|
622
|
+
code_challenge: PKCE code challenge
|
|
623
|
+
|
|
624
|
+
code_challenge_method: PKCE code challenge method
|
|
625
|
+
|
|
626
|
+
scope: Space-separated list of requested scopes
|
|
627
|
+
|
|
628
|
+
state: State parameter for CSRF protection
|
|
629
|
+
|
|
630
|
+
extra_headers: Send extra headers
|
|
631
|
+
|
|
632
|
+
extra_query: Add additional query parameters to the request
|
|
633
|
+
|
|
634
|
+
extra_body: Add additional JSON properties to the request
|
|
635
|
+
|
|
636
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
637
|
+
"""
|
|
638
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
639
|
+
return await self._get(
|
|
640
|
+
"/oauth/authorize",
|
|
641
|
+
options=make_request_options(
|
|
642
|
+
extra_headers=extra_headers,
|
|
643
|
+
extra_query=extra_query,
|
|
644
|
+
extra_body=extra_body,
|
|
645
|
+
timeout=timeout,
|
|
646
|
+
query=await async_maybe_transform(
|
|
647
|
+
{
|
|
648
|
+
"client_id": client_id,
|
|
649
|
+
"redirect_uri": redirect_uri,
|
|
650
|
+
"response_type": response_type,
|
|
651
|
+
"code_challenge": code_challenge,
|
|
652
|
+
"code_challenge_method": code_challenge_method,
|
|
653
|
+
"scope": scope,
|
|
654
|
+
"state": state,
|
|
655
|
+
},
|
|
656
|
+
oauth_retrieve_authorize_params.OAuthRetrieveAuthorizeParams,
|
|
657
|
+
),
|
|
658
|
+
),
|
|
659
|
+
cast_to=NoneType,
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
async def retrieve_jwks(
|
|
663
|
+
self,
|
|
664
|
+
*,
|
|
665
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
667
|
+
extra_headers: Headers | None = None,
|
|
668
|
+
extra_query: Query | None = None,
|
|
669
|
+
extra_body: Body | None = None,
|
|
670
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
671
|
+
) -> OAuthRetrieveJwksResponse:
|
|
672
|
+
"""Retrieve the JSON Web Key Set for token verification"""
|
|
673
|
+
return await self._get(
|
|
674
|
+
"/oauth/jwks",
|
|
675
|
+
options=make_request_options(
|
|
676
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
677
|
+
),
|
|
678
|
+
cast_to=OAuthRetrieveJwksResponse,
|
|
679
|
+
)
|
|
680
|
+
|
|
681
|
+
async def token(
|
|
682
|
+
self,
|
|
683
|
+
*,
|
|
684
|
+
grant_type: Literal["client_credentials", "authorization_code", "refresh_token"],
|
|
685
|
+
client_id: str | Omit = omit,
|
|
686
|
+
client_secret: str | Omit = omit,
|
|
687
|
+
code: str | Omit = omit,
|
|
688
|
+
code_verifier: str | Omit = omit,
|
|
689
|
+
redirect_uri: str | Omit = omit,
|
|
690
|
+
refresh_token: str | Omit = omit,
|
|
691
|
+
scope: str | Omit = omit,
|
|
692
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
693
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
694
|
+
extra_headers: Headers | None = None,
|
|
695
|
+
extra_query: Query | None = None,
|
|
696
|
+
extra_body: Body | None = None,
|
|
697
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
698
|
+
) -> OAuthTokenResponse:
|
|
699
|
+
"""
|
|
700
|
+
Exchange authorization code, client credentials, or refresh token for access
|
|
701
|
+
token
|
|
702
|
+
|
|
703
|
+
Args:
|
|
704
|
+
grant_type: OAuth 2.0 grant type
|
|
705
|
+
|
|
706
|
+
client_id: OAuth client ID (if not using HTTP Basic auth)
|
|
707
|
+
|
|
708
|
+
client_secret: OAuth client secret (if not using HTTP Basic auth)
|
|
709
|
+
|
|
710
|
+
code: Authorization code (for authorization_code flow)
|
|
711
|
+
|
|
712
|
+
code_verifier: PKCE code verifier (for authorization_code flow)
|
|
713
|
+
|
|
714
|
+
redirect_uri: Redirect URI (for authorization_code flow)
|
|
715
|
+
|
|
716
|
+
refresh_token: Refresh token (for refresh_token flow)
|
|
717
|
+
|
|
718
|
+
scope: Space-separated list of requested scopes (for client_credentials)
|
|
719
|
+
|
|
720
|
+
extra_headers: Send extra headers
|
|
721
|
+
|
|
722
|
+
extra_query: Add additional query parameters to the request
|
|
723
|
+
|
|
724
|
+
extra_body: Add additional JSON properties to the request
|
|
725
|
+
|
|
726
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
727
|
+
"""
|
|
728
|
+
return await self._post(
|
|
729
|
+
"/oauth/token",
|
|
730
|
+
body=await async_maybe_transform(
|
|
731
|
+
{
|
|
732
|
+
"grant_type": grant_type,
|
|
733
|
+
"client_id": client_id,
|
|
734
|
+
"client_secret": client_secret,
|
|
735
|
+
"code": code,
|
|
736
|
+
"code_verifier": code_verifier,
|
|
737
|
+
"redirect_uri": redirect_uri,
|
|
738
|
+
"refresh_token": refresh_token,
|
|
739
|
+
"scope": scope,
|
|
740
|
+
},
|
|
741
|
+
oauth_token_params.OAuthTokenParams,
|
|
742
|
+
),
|
|
743
|
+
options=make_request_options(
|
|
744
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
745
|
+
),
|
|
746
|
+
cast_to=OAuthTokenResponse,
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
class OAuthResourceWithRawResponse:
|
|
751
|
+
def __init__(self, oauth: OAuthResource) -> None:
|
|
752
|
+
self._oauth = oauth
|
|
753
|
+
|
|
754
|
+
self.retrieve = to_raw_response_wrapper(
|
|
755
|
+
oauth.retrieve,
|
|
756
|
+
)
|
|
757
|
+
self.grants = to_raw_response_wrapper(
|
|
758
|
+
oauth.grants,
|
|
759
|
+
)
|
|
760
|
+
self.introspect = to_raw_response_wrapper(
|
|
761
|
+
oauth.introspect,
|
|
762
|
+
)
|
|
763
|
+
self.register = to_raw_response_wrapper(
|
|
764
|
+
oauth.register,
|
|
765
|
+
)
|
|
766
|
+
self.retrieve_authorize = to_raw_response_wrapper(
|
|
767
|
+
oauth.retrieve_authorize,
|
|
768
|
+
)
|
|
769
|
+
self.retrieve_jwks = to_raw_response_wrapper(
|
|
770
|
+
oauth.retrieve_jwks,
|
|
771
|
+
)
|
|
772
|
+
self.token = to_raw_response_wrapper(
|
|
773
|
+
oauth.token,
|
|
774
|
+
)
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
class AsyncOAuthResourceWithRawResponse:
|
|
778
|
+
def __init__(self, oauth: AsyncOAuthResource) -> None:
|
|
779
|
+
self._oauth = oauth
|
|
780
|
+
|
|
781
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
782
|
+
oauth.retrieve,
|
|
783
|
+
)
|
|
784
|
+
self.grants = async_to_raw_response_wrapper(
|
|
785
|
+
oauth.grants,
|
|
786
|
+
)
|
|
787
|
+
self.introspect = async_to_raw_response_wrapper(
|
|
788
|
+
oauth.introspect,
|
|
789
|
+
)
|
|
790
|
+
self.register = async_to_raw_response_wrapper(
|
|
791
|
+
oauth.register,
|
|
792
|
+
)
|
|
793
|
+
self.retrieve_authorize = async_to_raw_response_wrapper(
|
|
794
|
+
oauth.retrieve_authorize,
|
|
795
|
+
)
|
|
796
|
+
self.retrieve_jwks = async_to_raw_response_wrapper(
|
|
797
|
+
oauth.retrieve_jwks,
|
|
798
|
+
)
|
|
799
|
+
self.token = async_to_raw_response_wrapper(
|
|
800
|
+
oauth.token,
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
class OAuthResourceWithStreamingResponse:
|
|
805
|
+
def __init__(self, oauth: OAuthResource) -> None:
|
|
806
|
+
self._oauth = oauth
|
|
807
|
+
|
|
808
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
809
|
+
oauth.retrieve,
|
|
810
|
+
)
|
|
811
|
+
self.grants = to_streamed_response_wrapper(
|
|
812
|
+
oauth.grants,
|
|
813
|
+
)
|
|
814
|
+
self.introspect = to_streamed_response_wrapper(
|
|
815
|
+
oauth.introspect,
|
|
816
|
+
)
|
|
817
|
+
self.register = to_streamed_response_wrapper(
|
|
818
|
+
oauth.register,
|
|
819
|
+
)
|
|
820
|
+
self.retrieve_authorize = to_streamed_response_wrapper(
|
|
821
|
+
oauth.retrieve_authorize,
|
|
822
|
+
)
|
|
823
|
+
self.retrieve_jwks = to_streamed_response_wrapper(
|
|
824
|
+
oauth.retrieve_jwks,
|
|
825
|
+
)
|
|
826
|
+
self.token = to_streamed_response_wrapper(
|
|
827
|
+
oauth.token,
|
|
828
|
+
)
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
class AsyncOAuthResourceWithStreamingResponse:
|
|
832
|
+
def __init__(self, oauth: AsyncOAuthResource) -> None:
|
|
833
|
+
self._oauth = oauth
|
|
834
|
+
|
|
835
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
836
|
+
oauth.retrieve,
|
|
837
|
+
)
|
|
838
|
+
self.grants = async_to_streamed_response_wrapper(
|
|
839
|
+
oauth.grants,
|
|
840
|
+
)
|
|
841
|
+
self.introspect = async_to_streamed_response_wrapper(
|
|
842
|
+
oauth.introspect,
|
|
843
|
+
)
|
|
844
|
+
self.register = async_to_streamed_response_wrapper(
|
|
845
|
+
oauth.register,
|
|
846
|
+
)
|
|
847
|
+
self.retrieve_authorize = async_to_streamed_response_wrapper(
|
|
848
|
+
oauth.retrieve_authorize,
|
|
849
|
+
)
|
|
850
|
+
self.retrieve_jwks = async_to_streamed_response_wrapper(
|
|
851
|
+
oauth.retrieve_jwks,
|
|
852
|
+
)
|
|
853
|
+
self.token = async_to_streamed_response_wrapper(
|
|
854
|
+
oauth.token,
|
|
855
|
+
)
|